Recent

Author Topic: Offline chm Help did not open local, Onlinehelp is only opend  (Read 13342 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1116
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #15 on: January 11, 2015, 05:40:55 pm »
For the second step (export to help conversion, fixing up links, CHM etc) have a look at the programs (.pp's) in the fpcdoc repository (the ones that postprocess the latex generated html to chm)

The problem is only to get the wiki content? After that, the rest of the process of generating help CHM files is still working?

I am not sure is this is helpful in any way, but I was searchin information on the CHM format file and about open source tools to convert from HTML (or XML) to CHM files and found:
http://linuxpoison.blogspot.com.br/2012/01/convert-chm-file-to-pdf-under-linux.html
http://www.russotto.net/chm/chmformat.html
https://code.google.com/p/html2chm/
https://www.openhub.net/p/html2chm
http://www.softpedia.com/get/Authoring-tools/Help-e-book-creators/Tarabi-html2chm.shtml
https://www.facebook.com/rabiul.khan.98622
http://cweiske.de/tagebuch/Generating%20CHM%20files%20with%20Wine%20on%20a%20Linux%20server,%20and%20a%20bit%20about%20PEAR's%20PhD%20transition.htm
« Last Edit: January 11, 2015, 07:42:17 pm by valdir.marcos »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #16 on: January 11, 2015, 07:03:45 pm »
The CHM conversion will probably be done using the fcl-xml (which also contains html DOM parsers) and package CHM for the Dom to CHM work.

External tools are not necessary. (and afaik no open source tool is crossplatform anyway, except for the FPC chm package)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #17 on: January 11, 2015, 07:29:53 pm »
The wiki does have an export page in the toolbox section.

 If you choose a Category (e. g. IDE) rather than a single page, it will export all pages in that category as a single .xml file. This may go part way to helping you get content (without slowing the wiki server to a crawl for other users).

I searched a bit, and found that export link, and the output looks decent in XML. It is wiki though, not html, so we would have to render that to html (not too difficult I hope)

So if we can create a list of topics from the source and mark them with a category in the wiki, we can at least manually export them.

So

  • Make list of IDE topics (software to do that regularly?)
  • Mark the relevant topics with a category
[li]export that category manually
[/li][/list]

Maybe another step would be to check the exported XML against the first topic list. (would yield a list of topics still to mark, deleted, not created etc)

af0815

  • Hero Member
  • *****
  • Posts: 1409
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #18 on: January 11, 2015, 08:41:36 pm »
I have also searched a little, and found a soloution only running in windows, but working.

it is possible to use the IE with activeX to scan part of the wiki automated with a pascalprogramm  O:-) . So i can reuse some code of the old wiki scanner.

One Goal is, which is the best format i have to convert to ? I got the wiki format or is better only to scan and do a preprocessing later ?!

AND i can scan more than only english, so it is possible to build also other languages content.

The result from scanning: http://wiki.lazarus.freepascal.org/Category:IDE_Window

Quote
IDE_Window:_Assembler
IDE_Window:Breakpoint_properties
IDE_Window:Breakpoints
IDE_Window:_Change_Encoding_Dialog
IDE_Window:_Character_Map
IDE_Window:_Clean_up_build_files_dialog
IDE_Window:_Code_Explorer
IDE_Window:_Code_Templates
IDE_Window:_Codetools_Defines_Editor
IDE_Window:_Configure_Build_file
IDE_Window:_Call_Stack
IDE_Window:_Divider_Drawing
IDE_Window:_Debug_Output
IDE_Window:_Debugger_Options
IDE_Window:_Debugger_Options/pt
IDE_Window:_Edit_Tool
IDE_Window:_Editor_Options_Code_Folding
IDE_Window:_Editor_Options_Display
IDE_Window:_Editor_Options_General
IDE_Window:_Editor_Options_General_Misc
IDE_Window:_Editor_Options_HighlightColors
IDE_Window:_Editor_Options_Keymap
IDE_Window:_Editor_Options_Mouse
IDE_Window:_Editor_User_Defined_Words
IDE_Window:_Editor_Window_Manager
IDE_Window:_EditorMouseOptionsAdvanced
IDE_Window:_Evaluate/Modify
IDE_Window:_Event_Log
IDE_Window:_Find_or_Rename_identifier
IDE_Window:_Debug_History
IDE_Window:_Add_directory_to_package
IDE_Window:_Add_to_Package
IDE_Window:_Anchor_Editor
IDE_Window:_Clean_Directory
IDE_Window:_Code_Explorer_Options
IDE_Window:_Codetools_Directory_Values
IDE_Window:_Codetools_Options
IDE_Window:_Conditional_Defines
IDE_Window:_Configure_Build_Lazarus
IDE_Window:_Create_new_package_component
IDE_Window:_Diff
IDE_Window:_Editor_Macros
IDE_Window:_Editor_Options
IDE_Window:_Editor_Options_Completion_Hints
IDE_Window:_Editor_Options_Markup
IDE_Window:_Editor_Options_MultiWindow
IDE_Window:_Environment_Options
IDE_Window:_External_Tool
IDE_Window:_External_Tools
IDE_Window:_Find
IDE_Window:_Find_in_files
IDE_Window:_Find_Unused_Units
IDE_Window:_Help_Options
IDE_Window:_IDE_Options_Dialog
IDE_Window:_Installed_Packages
IDE_Window:_JCF_Format_Settings_Options
IDE_Window:_Messages
IDE_Window:_Options
IDE_Window:_Package_Editor
IDE_Window:_Package_Graph
IDE_Window:_Package_Options
IDE_Window:_ToDo_List
IDE_Window:_Local_Variables
IDE_Window:_Publish_Project_Package
IDE_Window:_Registers
IDE_Window:_Run_parameters
IDE_Window:_Search_Results
IDE_Window:_Sort_selection
IDE_Window:_Threads
IDE_Window:_Unit_dependencies
IDE_Window:_Unit_info
IDE_Window:_View_project_forms_units
IDE_Window:_Variable_Inspector
IDE_Window:_Watch_list
IDE_Window:_Watch_Properties
« Last Edit: January 11, 2015, 08:43:40 pm by af0815 »
regards
Andreas

af0815

  • Hero Member
  • *****
  • Posts: 1409
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #19 on: January 11, 2015, 08:46:51 pm »
A Scan from http://wiki.lazarus.freepascal.org/index.php?title=IDE_Window:_Code_Templates

This is the Wiki Format, like seen in the buit in Editor.

Quote
{{IDE Window: Code Templates}}

== What are Code Templates? ==

A Code Template is a section of 'boiler plate' code with an associated abbreviation which invokes its insertion. For example, you can type 'cl' in the Source Editor, and then press the Ctrl+J keyboard shortcut to invoke the code template(s) starting with 'cl'.
This feature is a great time saver.

The Code Templates dialog (accessed via the Tools|Code Templates... menu option) allows you to edit existing templates, or add your own templates.

Code template text can contain macros, and you can even add your own macros to the list of those already available by creating a design time package and using the macrointf.pas of the IDEIntf package.

== Example 1 - ifb ==

type
<pre>
  ifb|
</pre>

Here the pipe symbol (|) represents the blinking screen cursor. Press Ctrl+j. The three characters you typed ('ifb') will be expanded to

<pre>
  if | then begin

  end;
</pre>

Again the pipe represents the cursor blinking onscreen. You will see that the cursor has been moved.
This template is called 'ifb' and it is defined as follows:
<pre>
if | then begin

end;
</pre>

This time the pipe '|' is an actual character you type as part of this code template's definition. It stipulates where the cursor will be positioned after the template has been inserted.

== Example 2 - Using macros ==

This second example shows you how to create a code template 'w' which repeats the name of the current procedure somewhere in your code. For long names this can be quite a time saver, and it also types it for you without any spelling mistakes!

* In the Code Templates dialog, click on the [Add] button. In the dialog which pops up set Token to 'w', and Comment to 'writeln(ProcName)', then click [OK].
* Your new code template item has been added to the list box.
* In the source below fill in
  writeln(' ',|);
* Here pipe is an actual pipe character defining the new cursor position. Now place the cursor after the first apostrophe (') and click on the 'Insert macro' button. A dialog pops up listing all available code macros. Choose 'ProcedureName' and click 'Insert Macro'. You should now have:
  writeln('$ProcedureName() ',|);
* Click [OK] to save and close the Code Templates dialog.
* Move the cursor into the body of a method, and type 'w'. For instance:
  procedure TForm1.FormDestroy(Sender: TObject);
  begin
    w|
  end;
(Here the pipe represents the blinking cursor, not a character).
* Press Ctrl+j. You will get:
  procedure TForm1.FormDestroy(Sender: TObject);
  begin
    writeln('TForm1.FormDestroy ',|);
  end;

==Template Autocompletion==

Code templates are invoked either by using the Ctrl+j shortcut, or (if you set this option) automatically following particular events. For each template you can specify the event (if any) that automatically invokes it. You can enable none, some or all of the following events:

*line break - insert the template whenever the user presses the [Return] or [Enter] key
*space - insert the template whenever the user presses the [Space bar].
*word end - whenever the user presses a word-ending key. For example, when typing 'b;' the code template 'b' can be executed.
*do not add character - this option can be combined with any of the above. When enabled the triggering key itself will not be inserted. For example when the option 'space' is enabled and the user triggers a template insertion by pressing the space bar, the space character itself will not be inserted in the source editor.

==Macros==

Macros have the form '''$(MacroName)''' or '''$MacroName(Param1,...)'''. Macros can be nested.

===Define your own macros===

You can register your own macros by writing a design time package and installing it.
See ide/codetemplatesdlg.pas procedure CreateStandardCodeMacros for examples.

=DCI file format=

The default dci file of the IDE is ''pcp/lazarus.dci'', where ''pcp'' is your primary config path (e.g. under Linux $HOME/.lazarus). If this file is not present the IDE will copy the file ide/lazarus_dci_file.dci.

A dci file is a text file with a list of templates.

Each template starts with line [name | description].
The template's value are the following lines.

[[Category:IDE Window|C]]
regards
Andreas

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #20 on: January 12, 2015, 09:27:36 am »
I think wiki format is fine. Most constructs translate 1:1.

The exact key in the code templates window can be gotten from docs/idewindowhelptree.xml (which is a mapping of dialog name to topic name)

Note that it uses a page-anchor system. (e.g. a page per dialog, but help on the various tabs on that dialog translate to an anchor on the webpage).

Many of the htmlsystems can't deal very well with anchors. (e.g. if we ever want to use native CHM help instead of lhelp on Windows)

af0815

  • Hero Member
  • *****
  • Posts: 1409
Re: Offline chm Help did not open local, Onlinehelp is only opend
« Reply #21 on: January 12, 2015, 02:49:23 pm »
Today the code is a Q&D project :-) So i have to do some improvements.

But a questen for me is, the layout of the diretories for the project. I should be compatible with the existing layout, bust have to be multilanguage, because the wiki is able for this and have some translated content. If it works for other languages (russian,... ), i dont know yet.

What kind of extension should i give the wiki files ? .wiki .txt  ?

regards
Andreas

 

TinyPortal © 2005-2018