libtidy.dll

TedM
2011-08-06
2012-11-13
1 2 > >> (Page 1 of 2)
  • TedM
    TedM
    2011-08-06

    I have installed NPP 5.9.3 and TextFX 0.26. HTML Tidy under TextFX apparently does not include libtidy.dll. I have tried downloading several versions of libtidy.dll, but NPP has rejected all of them as incompatible with Unicode. Where can I find the correct DLL version?

     
  • Vera
    Vera
    2011-08-06

    Hi,

    the quickest way to get it is to download a previous NPP-version that still contained all docs and config files.
    It must be v590 or below.
    It definitely is part of the Notepad++ v5.9 zip package: http://notepad-plus-plus.org/download/v5.9.0.html

    cheers

     
  • TedM
    TedM
    2011-08-07

    Thanks! That worked. But I don't understand why 5.9.3 doesn't include everything 5.9.0 had, or at least provide a note advising users to install 5.9.0 first and then upgrade (which appears to be the intent). Very confusing.

     
  • cchris
    cchris
    2011-08-07

    I thnk the whole idea is that the archive oackages are for upgrades by experienced usrs - so since they upgrade, they don't need the separate dll.
    For those who installed without he extension and then wish they had included it, then they can run the installer agan. It is rather customisable, so you don't get much unwanted stuff, if any.

    Again, I don't know Don's idea behind not providing he sparate dll. Just a thought on why it could be a good idea.

    CChris

     
  • TedM
    TedM
    2011-08-07

    I did use the installer for 5.9.3. It did not include TextFX, so I downloaded it separately. That download did not include libtidy.dll. After rummaging around the Internet to find a version of that DLL that worked, I signed up with Sourceforge and wrote my original post. I don't know why it's necessary to make new users bang their heads against the wall like that.

    For what it's worth, I was a long time user of UltraEdit. That's a great editor, but I was getting tired of the bloat and "upgrade treadmill" its publisher was creating. After I saw the latest version, I decided it might be time to consider something else rather than buying it. I had been using an old version of N++ on a different computer, and found that it had everything I needed (and was somewhat friendlier than UltraEdit). So I deleted UltraEdit and installed the latest version of N++. I had no idea that the plug-ins included with older versions had disappeared. Makes no sense at all.

     
  • Matthew Kastor
    Matthew Kastor
    2011-08-10

    I've been having trouble with the TextFX plugin as well. It keeps crashing notepad++ when I try to run the TidyHTML options. I'm using the libtidy.dll located here http://www.paehl.com/open_source/?download=libtidy.7z

    I found this version by visiting http://tidy.sourceforge.net/, looking in the list of executable binaries, and going for the one by Dirk Paehl which is marked "current". His page http://www.paehl.com/open_source/?HTML_Tidy_for_Windows says he used the "HTML Tidy for Windows (vers 25 mar 2009)" above his link to the executable, so I'm assuming that he used the same source to compile the dll.

    I've tried reinstalling notepad++, ensuring to delete the notepad++ folder in my user account's application data folder before reinstalling. For good measure I also ran ccleaner on the registry before reinstalling as well. This didn't change anything. I got the same behavior as before.

    I like having HTML Tidy integrated with the text editor and, having multiple configurations available by drop down menu.

    In the meantime, I'm using this php script to run html tidy. Obviously you need the tidy extension enabled.

    <?php

    /*
    * $what_to_clean is a string of html. If you want to run this function on a file
    * then you can use file_get_contents( ) to get the file contents into a string.
    *
    * $tidy_config is an array containing the configuration options for tidy.
    * If you don't supply the configuration options it uses the default options
    * defined in the function.
    *
    * example use on string
    * $html = '<p>some html</p>';
    * echo cleaning( $html );
    *
    * example use on file
    * $html = file_get_contents( 'path/to/file/some.html' );
    * echo cleaning( $html );
    *
    * example use on remote file
    * $html = file_get_contents( 'http://some/remote/file.html' );
    * echo cleaning( $html );
    *
    * of course you can save the output to a file instead of echoing it with
    * $html = '<p>some html</p>';
    * $html = cleaning( $html );
    * file_put_contents( 'tidied.html', $html );
    */
    function cleaning($what_to_clean, $tidy_config='' ) {

    $config = array(
    'show-body-only' => false,
    'clean' => true,
    'char-encoding' => 'utf8',
    'add-xml-decl' => true,
    'add-xml-space' => true,
    'output-html' => false,
    'output-xml' => false,
    'output-xhtml' => true,
    'numeric-entities' => false,
    'ascii-chars' => false,
    'doctype' => 'strict',
    'bare' => true,
    'fix-uri' => true,
    'indent' => true,
    'indent-spaces' => 4,
    'tab-size' => 4,
    'wrap-attributes' => true,
    'wrap' => 0,
    'indent-attributes' => true,
    'join-classes' => false,
    'join-styles' => false,
    'enclose-block-text' => true,
    'fix-bad-comments' => true,
    'fix-backslash' => true,
    'replace-color' => false,
    'wrap-asp' => false,
    'wrap-jste' => false,
    'wrap-php' => false,
    'write-back' => true,
    'drop-proprietary-attributes' => false,
    'hide-comments' => false,
    'hide-endtags' => false,
    'literal-attributes' => false,
    'drop-empty-paras' => true,
    'enclose-text' => true,
    'quote-ampersand' => true,
    'quote-marks' => false,
    'quote-nbsp' => true,
    'vertical-space' => true,
    'wrap-script-literals' => false,
    'tidy-mark' => true,
    'merge-divs' => false,
    'repeated-attributes' => 'keep-last',
    'break-before-br' => true,
    );

    if( $tidy_config == '' ) {
    $tidy_config = &$config;
    }

    $tidy = new tidy();
    $out = $tidy->repairString($what_to_clean, $tidy_config, 'UTF8');
    unset($tidy);
    unset($tidy_config);
    return($out);
    }

    ?>

     
  • Gunther Blue
    Gunther Blue
    2012-02-16

    Why is there no unicode Tidy.dll?

     
  • Clayton Dukes
    Clayton Dukes
    2012-08-17

    Why did you guys take a great program and break it? I can't get tidy to work at all - the old dll mentioned above just crashes.
    Man, I love this tool - I hate when companies/people decide to add new "features" and break their tool.

     
  • Matthew Kastor
    Matthew Kastor
    2012-08-17

    @cdukes

    I\'m still using the same version of libtidy.dll that I mentioned in my last post and it\'s working.
    Where to download the file: http://www.paehl.com/open_source/?download=libtidy.7z
    Details about the file: http://www.paehl.com/open_source/?HTML_Tidy_for_Windows

    I\'m using Notepad++ 6.16 (UNICODE)

    To \"install\" the dll you just unzip the downloaded file and paste it into the \"tidy\" folder. You can find the folder at Notepad++\\plugins\\tidy The Notepad++ folder will be wherever you installed Notepad++ to, probably the program files folder.

    Here is a copy of TIDYCFG.INI that I modified to give me good results in a variety of different ways. The file goes in the tidy folder inside the config folder at Notepad++\\plugins\\config\\tidy

    ; quick reference: tidy.sourceforge.net/docs/quickref.html 
    ; cesky preklad:   www.pspad.com/cz/tidy.htm
    ; sample config file for HTML tidy from www.w3.org/People/Raggett/tidy/
    [Kastor tidy - XHTML page UTF-8]
    add-xml-decl:yes
    show-body-only: no
    clean: no
    char-encoding: utf8
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - HTML page UTF-8]
    show-body-only: no
    clean: no
    char-encoding: utf8
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - XHTML fragment UTF-8]
    show-body-only: yes
    clean: no
    char-encoding: utf8
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - HTML fragment UTF-8]
    show-body-only: yes
    clean: no
    char-encoding: utf8
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - XHTML Clean page UTF-8]
    add-xml-decl:yes
    show-body-only: no
    clean: yes
    css-prefix: tidy
    char-encoding: utf8
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: yes
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: yes
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    drop-font-tags: yes
    enclose-text: yes
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    word-2000: no
    [Kastor tidy - HTML Clean page UTF-8]
    show-body-only: no
    clean: yes
    css-prefix: tidy
    char-encoding: utf8
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: yes
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: yes
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    drop-font-tags: yes
    enclose-text: yes
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    word-2000: no
    [Kastor tidy - XHTML Clean fragment UTF-8]
    show-body-only: yes
    clean: yes
    css-prefix: tidy
    char-encoding: utf8
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: yes
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: yes
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: yes
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    word-2000: no
    [Kastor tidy - HTML Clean fragment UTF-8]
    show-body-only: yes
    clean: yes
    css-prefix: tidy
    char-encoding: utf8
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: yes
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: yes
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: yes
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    word-2000: no
    [Kastor tidy - XHTML fragment raw]
    show-body-only: yes
    clean: no
    char-encoding: raw
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - XHTML fragment ascii]
    show-body-only: yes
    clean: no
    char-encoding: ascii
    output-html: no
    output-xml: no
    output-xhtml: yes
    ascii-chars: no
    doctype: strict
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - HTML fragment raw]
    show-body-only: yes
    clean: no
    char-encoding: raw
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [Kastor tidy - HTML fragment ascii]
    show-body-only: yes
    clean: no
    char-encoding: ascii
    output-html: yes
    output-xml: no
    output-xhtml: no
    ascii-chars: no
    doctype: transitional
    bare: no
    fix-uri: yes
    indent: yes
    indent-spaces: 4
    tab-size: 4
    wrap-attributes: yes
    wrap: 0
    indent-attributes: yes
    join-classes: no
    join-styles: no
    enclose-block-text: yes
    fix-bad-comments: yes
    fix-backslash: yes
    replace-color: no
    wrap-asp: no
    wrap-jste: no
    wrap-php: no
    write-back: yes
    drop-proprietary-attributes: no
    hide-comments: no
    hide-endtags: no
    literal-attributes: no
    drop-empty-paras: yes
    enclose-text: no
    quote-ampersand: yes
    quote-marks: no
    quote-nbsp: yes
    vertical-space: yes
    wrap-script-literals: no
    tidy-mark: no
    merge-divs: no
    repeated-attributes: keep-last
    break-before-br: yes
    [TiDy clean Microsoft Word 2000 document]
    doctype:auto
    drop-empty-paras:yes
    fix-bad-comments:yes
    fix-uri:yes
    join-styles:yes
    lower-literals:yes
    ncr:yes
    quote-ampersand:yes
    quote-nbsp:yes
    word-2000:yes
    markup:yes
    wrap-jste:yes
    wrap-php:yes
    wrap-sections:yes
    write-back:yes
    [TiDy clean Document - quote]
    quote-ampersand:yes
    quote-marks:yes
    quote-nbsp:yes
    write-back:yes
    [TiDy upgrade to CSS]
    add-xml-decl:no
    ;add-xml-pi:no
    alt-text:Image
    break-before-br:no
    clean:yes
    doctype:auto
    drop-empty-paras:no
    drop-font-tags:yes
    fix-backslash:yes
    fix-bad-comments:yes
    hide-endtags:no
    char-encoding:raw
    indent:yes
    indent-spaces:2
    input-xml:no
    markup:yes
    quiet:yes
    tidy-mark:no
    uppercase-attributes:no
    uppercase-tags:no
    word-2000:yes
    wrap:100
    wrap-asp:yes
    wrap-attributes:yes
    wrap-jste:yes
    wrap-php:yes
    write-back:yes
    [TiDy convert to XML]
    add-xml-decl:yes
    ;add-xml-pi:yes
    alt-text:Image
    break-before-br:no
    clean:yes
    doctype:AUTO
    drop-empty-paras:no
    drop-font-tags:yes
    fix-bad-comments:yes
    hide-endtags:no
    char-encoding:raw
    indent:yes
    indent-spaces:2
    input-xml:no
    markup:yes
    output-xml:yes
    quiet:yes
    tidy-mark:no
    uppercase-attributes:no
    uppercase-tags:no
    word-2000:no
    wrap:100
    wrap-asp:yes
    wrap-attributes:yes
    wrap-jste:yes
    wrap-php:yes
    write-back:yes
    [Tidy convert to XHTML]
    add-xml-decl:no
    ;add-xml-pi:no
    alt-text:Image
    break-before-br:no
    clean:yes
    doctype:auto
    drop-empty-paras:no
    drop-font-tags:yes
    error-file:error.log
    fix-backslash:yes
    fix-bad-comments:yes
    hide-endtags:no
    char-encoding:raw
    indent:yes
    indent-spaces:2
    input-xml:no
    markup:yes
    output-xhtml:yes
    output-xml:no
    quiet:yes
    tidy-mark:no
    uppercase-attributes:no
    uppercase-tags:no
    word-2000:no
    wrap:100
    wrap-asp:yes
    wrap-attributes:yes
    wrap-jste:yes
    wrap-php:yes
    write-back:yes
    [Tidy Reindent XML]
    input-xml: yes
    indent:yes
    

    If you\'re still having trouble then write back. I\'ll try to help you if you\'re nice.

     
  • myurkus
    myurkus
    2012-08-23

    I have been trying to get "tidy" to work for hours now, can someone please help?

    With the new dll (notepad++ version 6, new tidy dll,) I receive the following error when loading Notepad++ after copying libtidy.dll in the plugins directory:

    ---------------------------
    C:\Program Files (x86)\Notepad++\plugins\libtidy.dll
    ---------------------------
    This ANSI plugin is not compatible with your Unicode Notepad++.
    This plugin is not compatible with current version of Notepad++.
    Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?
    ---
    

    I even grabbed version 5.9 - on the ASCII version I receive the following error when starting up:

    ---------------------------
    D:\aaaaSSDData\MikeySSD\Downloads New\Notepad++ stuff\npp.5.9.bin\ansi\plugins\libtidy.dll
    ---------------------------
    Missing "setInfo" function
    This plugin is not compatible with current version of Notepad++.
    Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?
    ---------------------------
    Yes   No   
    ---------------------------
    

    Finally, the original version does not even work, it gives me the following error when trying to run: (This is on the ASCII version 5.9:)

    <?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <html>
      <head>
        <meta name="generator" content=
        "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
        <title></title>
      </head>
      <body>
      </body>
    </html>
    

    Why is this so difficult???

    Thanks a bunch in advance for your help!
    MikeY

     
  • Matthew Kastor
    Matthew Kastor
    2012-08-23

    @myurkus

    Scroll up.

     
  • myurkus
    myurkus
    2012-08-25

    LOL nice response… :) (heh…ok I'll take a hint. ;) I thought I went through your instructions, but I'll try going through it again completely from scratch. I'll get back to you and let you know how it goes.

    I actually am thinking about writing my own "Tidy", I've been wanting my own source-code that I could play-with/muck-up on my own. I've actually been considering doing this for a few years now. (I'm a software engineer; lol I guess you wouldn't know that if I am missing something completely obvious from your post. :)

    Thanks for the response - just letting me know you saw it is motivating me to look into this some more…
    MikeY

     
  • Matthew Kastor
    Matthew Kastor
    2012-08-25

    @myurkus

    I've been using the version of notepad++ from portableapps.com lately. It's nice because I can carry it around on a flash drive and use it anywhere. One thing I have to do on that one is have a copy of the libtidy.dll and tidy.cfg in two places. Basically I have a tidy folder with these two files in both the plugins folder and the plugins\config folder. To make it easier I've pasted a copy of the Notepad++ tree below. I did some cutting on this tree to make it smaller but you'll be able to see exactly where the two tidy folders are. When I installed Notepad++ in the past, I didn't need to make two copies of the dll and configuration file. For some reason with the portable Notepad++, if I don't make the two copies then one folder will get moved, the other will get deleted and the next time I start Notepad++ tidy will not work. With the two copies in place all this sillyness stops. The portableapps version of Notepad++ is built from Notepad++ 6.1.6 and I'm using the same libtidy.dll mentioned in my post above.

    If you do write your own Tidy let me know. It would be good to see some HTML5 support built right in. :D

    C:\Users\kastor\Documents\applications\portable applications\portable apps platform\PortableApps\Notepad++Portable\App\[b]Notepad++>tree /F /A[/b]
    Folder PATH listing
    Volume serial number is 00000200 521B:A9C7
    C:.
    |   change.log
    |   config.model.xml
    |   config.xml
    |   [many other files]
    |   
    +---localization
    |       afrikaans.xml
    |      [many other files]
    |       
    +---plugins
    |   |   ComparePlugin.dll
    |   |   ctags.exe
    |   |  [many other files]
    |   |   
    |   +---APIs
    |   |       actionscript.xml
    |   |       c.xml
    |   |       cmake.xml
    |   |       [many other files]
    |   |       
    |   +---config
    |   |   |   Compare.ini
    |   |   |   converter.ini
    |   |   |   [many other files]
    |   |   |   
    |   |   +---JSLint
    |   |   +---NppFTP
    |   |   |       Certificates.xml
    |   |   |       NppFTP.xml
    |   |   |       
    |   |   \---tidy
    |   |           AsciiToEBCDIC.bin
    |   |           HTMLTIDY.CFG
    |   |           HTMLTIDY.ERR
    |   |           libTidy.dll
    |   |           TIDYCFG.INI
    |   |           W3C-CSSValidator.htm
    |   |           W3C-HTMLValidator.htm
    |   |           
    |   +---doc
    |   |   \---JSLintNpp
    |   |           README.txt
    |   |           
    |   \---tidy
    |           AsciiToEBCDIC.bin
    |           HTMLTIDY.CFG
    |           libTidy.dll
    |           TIDYCFG.INI
    |           tree.txt
    |           W3C-CSSValidator.htm
    |           W3C-HTMLValidator.htm
    |           
    +---themes
    |       Bespin.xml
    |       Black board.xml
    |       [many other files]
    |       
    +---updater
    |       gpup.exe
    |       
    \---user.manual
        |   faq.html
        |   index.html
        |   user.html
        |   
        +---[many other files and subfolders]
    
     
  • pogue972
    pogue972
    2012-09-07

    I'm using Notepad++ 6.1.6 on Win7 x64 and using the same settings as described by @matthewkastor as described above.  The tidy.dll file, along with his tidycfg.ini under plugins/config/tidy.  The TextFX dropdown menu loaded the dll and ini and has all the options, but when I choose one Notepad++ crashes with the following error:

    Win32Exception
    An exception has occured.  Notepad++ cannot recover and must be shut down.
    The exception details are as follows:
    Code: 0xC0000005
    Type: Access violation
    Exception address: 0x7756A2CE

    It creates a dmp file of the crash, which is unreadable.  Can I send this to someone?

    This happens if any option is chosen from the HTML Tidy options.  I've tried running NPP as admin, same thing.  Does there need to be an HTMLTIDY.CFG file in the same folder, and if so, what needs to be in that?

    I've found some users describing a similar problem here http://stackoverflow.com/questions/809636/notepad-html-tidy but nothing there seems to resolve the issue either.

    Thanks for he help.

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-07

    I've put a copy of TIDYCFG.INI here: I've  https://sourceforge.net/projects/matthewkastor.u/files/Text%20Processing/
    If there were any errors when you copied it from above, or you used the wrong encoding, or for whatever reason it's just not right… npp will crash. The version of libtidy.dll that works with npp does not support every setting from the tidy quick reference either. so if you add in some settings and npp crashes then just take them out again.

    For sure I use the Kastor tidy XHTML UTF8 and the HTML version, daily. Those will definitely work on UTF8 documents without BOM. I don't know what it will do if the byte order mark is set. If you're using ascii then try one of the ascii options. Tidy is easy to crash and it will take the npp down with it. I took a lot of time figuring out which options I could set but may have screwed them up since I wrote them down. Probably not, but it's possible.

    The other option would be to run tidy.exe as a console app. launched from the run menu. It would be really easy to set up but it wouldn't be quite as integrated. You'd probably end up having to reload from disk about half the time you run it but still, launched from a button is good too. http://npp-community.tuxfamily.org/documentation/notepad-user-manual/commands

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-07

    oh yes. TIDYCFG.INI is encoded in ANSII on my machine. I forgot to mention that.

     
  • pogue972
    pogue972
    2012-09-07

    I placed your tinycfg.ini over the old one and still the same problem.  I tried converting the encoding of the html file to UTF8 w/o BOM and also same.

    Not sure what else to try.  Its hard to troubleshoot since it doesn't give me much info other than just crashing when I try any of the options.

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-08

    What about the encoding of the file you're trying to tidy? It's weird that it would crash on you if you've got the known good tidy.dll, a known working version of npp, and a thoroughly tested tidycfg file. Maybe you need to change the char-encoding setting. http://tidy.sourceforge.net/docs/quickref.html

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-08

    Or reinstall npp and start over, making sure to use the plugin manager to install your plugins. . .

     
  • Right, to put an end (hopefully) to this misery, I've thrown together a new Tidy plugin, which uses the new tidy-html5 fork from w3c. There's no extra dll to install, and if the config doesn't exist it will create a little default.  It detects UTF8/ANSI encodings, and sets the appropriate options.

    You can have 3 different configs, which should be enough for most people.

    Just drop the DLL in the Notepad++\plugins directory.

    https://github.com/downloads/davegb3/NppTidy2/Tidy2_0.1.zip

    I'll do another post in the plugin development forum shortly.

    Let me know if you experience any issues!

    Cheers,
    Dave.

     
  • pogue972
    pogue972
    2012-09-08

    Thanks davegb3! That worked perfectly.

    It looks like the 3 different config files are all the same though, is that correct?

     
  • They are initially all generated the same, if they don't exist.  However you can edit them all individually, so you could have one that tidys HTML, removes unnecessary close tags etc, and a second one that spits out XHTML, and ensures all close tags are there, and so on.

    The files are simply tidy1.cfg, tidy2.cfg and tidy3.cfg in your %APPDATA%\Notepad++\plugins\config directory (or wherever your N++ config files live).

    Cheers,
    Dave.

     
  • myurkus
    myurkus
    2012-09-08

    Wow thanks a lot everyone!…lol you beat me to it davegb3. And thanks for the detailed and thought-out response matthewkastor.

    Dave- does your tidy also work on Xml/Xsd/Xsl-T? I'm looking for something to do that too - at work I have a program called XmlSpy to do it, but it's super-expensive and way overkill just to "Tidy" it. I'm sorry to ask for more :) but if you wrote it in the way I was thinking of doing it, it should be easy enough just to look for the close-tags of any xml/html/tag-based language, no? (</…>) (I was thinking putting every open-tag in a stack and just removing items from the stack everytime you see "</" …it's a pretty classic computer problem, if I was working at the university I'd consider making that a project for the students… )

    Unfortunately I can't look into these things this minute, but I'll get to it really soon, I love Notepad++ but I can't believe what a pain this is! (Normally Notepad++ is great with extensions, I even added a custom auto-fill and coloring scheme for AutoHotkey, a relatively unknown scripting language.)

    But I digress…thanks again, I'll post my results asap…

    MikeY

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-08

    @Dave

    Thanks Dave!

    I'll tinker with it today and do cartwheels if it all works without too much hassle!

    :D

     
  • Matthew Kastor
    Matthew Kastor
    2012-09-08

    <- does cartwheels, lands on rock, does more cartwheels…

    The tidy 2 plugin was easy to install and came with documentation. I didn't have to modify my existing settings from the textfx plugin other than cutting and pasting the section from the tidycfg.ini that I wanted into the tidy1.cfg file. I went through the documentation to check that all the old settings I had were supposed to do what I intended (for Kastor tidy - HTML page UTF-8). The settings were all the same except for the doctype. In the documentation it said that if I wanted an html 4.01 transitional doctype, then I had to change the setting from transitional to loose. I did that and it had no effect. I tried every setting for doctype that was listed in the documentation and none of them seemed to do anything. Ignoring this, I tried the new plugin against a few files and it looked like everything was working. Another issue I had was that after installing the tidy2 plugin npp crashed several times while I was editing the tidy1.cfg file.

    To summarize, I do like the new tidy plugin because it's using an updated version of tidy and it comes with the documentation for the specific release it was built against. However, the tidy used with the textfx plugin does exactly what I want already and does not crash npp when set up properly. Both plugins are dead simple to copy and paste into the proper directory. The textfx tidy allows me to create as many configurations as will fit into my dropdown menu and name them descriptively. So, for the moment I'll continue using the textfx tidy. Both of them are great, both of them have bugs. If the doctype and crashing features of tydy2 get fixed then I'd recommend using the new plugin.

     
1 2 > >> (Page 1 of 2)