Menu

#71 Language supporting for generated documentation

open
TridenT
4
2012-07-18
2006-03-03
firstrose
No

I found it's amazing that DelphiCodeToDoc IS ABLE TO
SUPPORT non-English output in generated documentation.

I wrote Chinese comments in my source files and
DelphiCodeToDoc does handle them corretly!

But since the <meta> label doesn't include charset
parameter,sometimes the charactors are displayed
incorrectly.

So,why not add multi-language support into
DelphiCodeToDoc? Just generate a additional parameter!

But there two charset for Chinese.One is gb2312 for
Simplified Chinese,and the other one is big5 for
Traditional Chinese.

Discussion

  • TridenT

    TridenT - 2006-03-03

    Logged In: YES
    user_id=248829

    Yes, Rui N. helps me few month ago to support double byte
    character.
    You can have details in this Tracker :
    https://sourceforge.net/tracker/index.php?
    func=detail&aid=930775&group_id=96281&atid=614258

    I was thinking most WebBrowser will autodetect the code
    page, but as you said, maybe it is not sufficient.

    So maybe I can add a new option to select the charset, if
    there is no other way to detect it.

    It is ok for you if I add an option in the setup ?

     
  • firstrose

    firstrose - 2006-03-04

    Logged In: YES
    user_id=1050853

    Yes,most browsers detect the codepage automatically.But
    when the non-English content is very little,they usually
    make mistakes.

    It's better to add an option in the configuration page,in
    my opinion.

    BTW:I found sth interesting.When I unchecked "Allow Html in
    Description",the Chinese comments will go shit sometimes.I
    checked the page source and found some bytes in my double-
    byte characters are converted into special escape sequence
    such as "²âÊÔ£"

    Oh,my god!

    Also,there is another bug: sometimes,when the name of
    members in a class is too long,DCTD will generate a wrapped
    hyperlink!

    Here I attached a file.You can use it to test DCTD.

    Thx!

     
  • firstrose

    firstrose - 2006-03-04

    Use it to test

     
  • firstrose

    firstrose - 2006-03-04

    Logged In: YES
    user_id=1050853

    I found some HTML files generated by DCTD have strange
    names such as
    DecodeSingleB64Message_0AF1.htm,sometimes.This caused
    corrupted hyperlink.

    I tried to compile DCTD myself in D5.But after I installed
    JVCL(96M after extraction!),modified some DCTD's code to
    fit D5....At last I found I MUST have D6 to compile DCTD!!!

     
  • TridenT

    TridenT - 2006-03-06

    Logged In: YES
    user_id=248829

    When I unchecked "Allow Html in Description",the Chinese
    comments will go shit sometimes

    I'm calling JvStr2Html.StringToHtml() method to convert
    string to HTML. But now you ask, it seems it works the
    wrong way !

    wrapped hyperlink!

    I will have a look to your file, thx !

    file suffix _0AF1

    I'm using a file suffix to differentiate overloaded method
    (same name). But normaly, the link is working well ! Have
    another test file ?

    I tried to compile DCTD myself in D5

    I'm working with Delphi7 Pro.
    Library used in project
    *DelphiCodeToDoc need the stable release of JCL&JVCL to
    compile: Package JVCL300CompleteJCL195-Build1848.
    It includes :
    -Jedi Code Library, Release 1.95
    -JEDI VCL v3.00 for D5-D7
    -Download this really nice work here :
    http://jvcl.sourceforge.net/

     
  • firstrose

    firstrose - 2006-03-07

    Logged In: YES
    user_id=1050853

    I'm calling JvStr2Html.StringToHtml() method to
    convert
    string to HTML. But now you ask, it seems it works
    the
    wrong way !

    OK

    I think I know why.

    In JvStrToHtml.StringToHtml,he writes:

    for I := 1 to Len do
    for J := Low(Conversions) to High(Conversions) do
    if Value[I] = Conversions[J].Ch
    then //incompatible!
    begin
    Inc(AddLen, StrLen(Conversions[J].Html) - 1);
    Break;
    end;

    Here it treat input as "single-byted character system".But
    on some DBCS inputs,it will
    get a shit.Because in DBCS,two bytes(all > 128 ) are
    combined to figure a character.Not only Chinese,but also
    Russian,Japanese...So I do HTML encoding myself.

    =======>>>wrapped hyperlink!
    =======I will have a look to your file.

    Sorry!In fact,it's the same bug caused by suffix!Not
    wrapped!I made a wrong judgement!

    I'm using a file suffix to differentiate overloaded
    method
    (same name). But normaly, the link is working well !
    Have
    another test file ?

    Yes,I re-tested the feature.It only happens on the
    methods.I don't think you're lacking of test files on this
    topic.Because I tried your ParseTreeNode.pas and it also
    showed me the wrong link :-)

    I must point out that the TOC part has CORRECT links!

    This bug ONLY emerges in the method pages.

    Also,there is a difference between our test environments:
    You are using a SBCS system while I use a DBCS one.But I
    don't think it affects the hyperlink!

    I'll take another effort to compile DCTD.

    At last,forgive me for my poor English,please.

     
  • firstrose

    firstrose - 2006-03-07

    the TOC part has CORRECT links

     
  • firstrose

    firstrose - 2006-03-07

    Another file for test

     
  • firstrose

    firstrose - 2006-03-07

    Logged In: YES
    user_id=1050853

    I should say Good Morning to you!Though it's afternoon at
    China.

    I must say I solved the "suffix"!

    Well,here's some code you wrote in TDOCGenHTML.AddToolBar

    PrevLink := HTMLBuildLink(Format('%s (%s)',
    

    [L_Previous, PreviousItem.Name]),
    PreviousItem.Name)

    NextLink := HTMLBuildLink(Format('%s (%s)', [L_Next,
    

    NextItem.Name]), NextItem.Name)

    I think they generates the links.When there's no overloaded
    member, TDOCTemplate.Name=TDOCTemplate.GetFileName.If there
    is an overloaded
    member,TDOCTemplate.Name<>TDOCTemplate.GetFileName.

    You save files named by GetFileName while generate links
    with Name.Here it is!

    I changed them into

    PrevLink := HTMLBuildLink(Format('%s (%s)',
    

    [L_Previous, PreviousItem.Name]),
    PreviousItem.GetFileName)

    NextLink := HTMLBuildLink(Format('%s (%s)', [L_Next,
    

    NextItem.Name]), NextItem.GetFileName)

    And everything goes well!

     
  • TridenT

    TridenT - 2006-03-14

    Logged In: YES
    user_id=248829

    I must say I solved the "suffix"!

    Ok, I hadn't understand it was in the toolbar.
    Ok, I reproduced the bug with your file, and accpeted your
    fix. Good work ! thx a lot .
    I will now work on
    'JvStrToHtml.StringToHtml'

     
  • firstrose

    firstrose - 2006-03-15

    Logged In: YES
    user_id=1050853

    I will now work on
    'JvStrToHtml.StringToHtml'

    I think such convert MUST depend on the codepage.So I will
    try to write an alternative function for it.

    I like DCTD.

    Please inform me before the official release.

     
  • TridenT

    TridenT - 2006-03-29

    Logged In: YES
    user_id=248829

    I will check if it is fixed in JCL library.
    I will keep you informed.
    next revision should be around 15 April.

     
  • firstrose

    firstrose - 2006-03-30

    Logged In: YES
    user_id=1050853

    Thank you
    Time is enough waiting the hotfix of JCL

    You know, if a label '<object ' is put into comments,it
    will cause strange scene.

     
  • firstrose

    firstrose - 2006-03-30

    html label in comments

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.