1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00
cdt/doc/org.eclipse.cdt.doc.user
2025-01-14 21:14:59 +00:00
..
.settings Lower build.properties errors to warnings for some projects 2022-11-07 23:13:26 -05:00
cheatsheets Replaced C/C++ Project view with Project Explorer view 2010-07-05 15:54:59 +00:00
concepts Update wiki.eclipse links to their new locations 2022-11-09 10:56:55 -05:00
font-awesome Font Awesome 4.7 2025-01-14 13:05:53 -05:00
images Add "Creating a CMake Project" help page 2024-11-12 08:39:30 +00:00
intro Bug 460370 - Remove reference to CDT project name in Welcome screen 2015-02-19 13:46:31 -05:00
META-INF Bump version to CDT 12.0.0 (#911) 2024-10-08 12:52:15 -04:00
reference Bug 571722: Add ALL_FLAGS for scanner discovery 2022-11-21 10:46:49 -05:00
setting_up_eclipse_cdt Update wiki.eclipse links to their new locations 2022-11-09 10:56:55 -05:00
src Fix "Creating a CMake Project" cross-reference 2025-01-14 21:14:59 +00:00
tasks Bug 568728: Drop execute permission on files 2020-11-18 17:38:22 +01:00
.asciidoctorconfig.adoc Add AsciiDoc build infrastructure 2024-08-23 16:26:56 +01:00
.gitignore Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
.project Upgrade to Eclipse 3.0. Includes: 2003-11-24 18:31:03 +00:00
about.html [releng] Update all legal files with update_legal_files.sh 2022-04-13 13:42:35 -04:00
adoc-headers.txt Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
book.css Bug 341483 - [Accessibility] CDT documentation has accessibility issues 2011-03-31 13:59:18 +00:00
build.properties Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
contexts_CDT.xml Bug 568728: Drop execute permission on files 2020-11-18 17:38:22 +01:00
contexts_CDT_DEBUGGER.xml Bug 472765: User documentation for Path Mapping 2016-04-13 10:41:46 -05:00
contexts_CDT_DEBUGGER_DSFGDB.xml Bug 389527: Update DSF-GDB preference page help 2012-09-17 14:34:28 -04:00
contexts_CDT_DEBUGGER_MI.xml Fix for bug 209005 2007-11-13 16:53:07 +00:00
contexts_CDT_LAUNCH.xml Bug 446013 - Improvements to CDT launch configurations context help 2014-11-04 09:32:21 -05:00
contexts_CDT_make.xml bug 422558: Managed build projects context help is broken 2014-01-07 10:21:18 -05:00
customBuildCallbacks.xml Bug 540373: Normalize newlines with .gitattributes 2018-11-20 21:20:39 +00:00
help.css Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
helpadoc.css Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
notices.html Bug 389951 - [Accessibility] CDT documentation has accessibility issues 2012-09-19 21:17:46 -04:00
plugin.properties Bug 540373: Cleanup: Remove trailing whitespace in properties files 2018-11-23 07:52:26 +00:00
plugin.xml Bug 446013 - Improvements to CDT launch configurations context help 2014-11-04 09:32:21 -05:00
pom.xml Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
README.md Generate more of the documentation with asciidoc and automate more 2025-01-14 13:05:53 -05:00
toc.xml bug 315992: What's New and Noteworthy in CDT 7.0? 2010-06-07 19:34:15 +00:00
topics_Concepts.xml Add help content anchor for C/C++ editor contributions 2024-12-13 15:32:21 +00:00
topics_Getting_Started.xml Description of the Core Build System. (#960) 2025-01-14 14:15:18 -05:00
topics_Reference.xml Add help content support for C/C++ editor preference pages 2024-12-17 21:24:13 +00:00
topics_Tasks.xml Bug 520340: enable CLI to CDT's code formatter 2017-11-02 07:03:22 -04:00

C/C++ Development User Guide

AsciiDoc content

The Asciidoctor Maven Plugin is configured to generate an HTML file in the html/ folder for each AsciiDoc source file (*.adoc) placed in the src/asciidoc/ folder.

All AsciiDoc source files should include GitHub rendering support, as illustrated in the example document.

During content development, HTML files may be generated by invoking Maven locally:

mvn --define jgit.dirtyWorkingTree-cdtDefault=ignore --projects org.eclipse.cdt:org.eclipse.cdt.doc.user generate-resources
# or to turn on auto-refresh
mvn --define jgit.dirtyWorkingTree-cdtDefault=ignore --projects org.eclipse.cdt:org.eclipse.cdt.doc.user generate-resources -P asciidoc-auto-refresh

Adding -DuseSimrelRepo, and after first run -o can speed up target platform resolution speed significantly.

Embedding commands in help

Embedding commands in help needs to modify syntax slightly. Links in adoc are always surrounded by double-quotes, therefore single-quotes (') or escaped double-quote (") need to be used in the command, as appropriate, this is opposite to the quoting that is shown in the Eclipse help documentation. See the Eclipse help for general information.

e.g. opening a preference page can be done like this:

image:command_link.png[] link:javascript:executeCommand('org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.ui.preferencePages.Editors)')[General > Editors]

Notes:

  • The livehelp.js is included automatically with docinfo-header.htm
  • PLUGINS_ROOT cannot be used within the adoc files, so use image:command_link.png[] instead

Converting html CDT help to adoc

Use pandoc, e.g.:

pandoc getting_started/cdt_w_basic.htm -o src/getting_started/cdt_w_basic.adoc
# or a whole group of files
for i in getting_started/*; do pandoc -o src/${i%.*}.adoc $i; done

Apply these changes after:

  • Replace image:../images/ -> image: because we use images in different locations depending on whether we are in GitHub or in online help
  • Replace link:([^[]+).htm\[ -> xref:$1.adoc[ so that links are always to adoc files. Asciidoctor will change that to htm on generation so if target has not been converted yet that is ok. This allows links to work when asciidoctor generates for other formats
  • Fix anchors \[#([^\]]+)\]#### -> [[$1]]
  • Fix unneeded   with \u00A0 -> nothing (some of these were used to indent makefiles, but that meant they couldn't be copied and pasted anyway, so another solution is needed)
  • Remove doubled-up line continuation characters ^\+\n \+ -> +
  • Remove extra + around horizontal rulers (lines with ''''') '''[\n\s]+\+ -> ''' and *\+[\n\s]+''' -> '''
  • Removed unneeded line breaks (.) \+$ -> $1 (lines that have just + are list continuation)
  • Since C++ uses a double + it can confuse asciidoc, replace C\+\+ -> {cpp} (the C++ attribute). See Character Replacement Attributes Reference for all built-in attributes.
  • Remove copyright statements from bottom of files (the docinfo-footer.htm has copyright)
  • Fix the related concepts/tasks in the footer (convert to lists?)
  • Add the headers to the adoc file to enable all the features and ensure consistent copyrights. See adoc-headers.txt
  • Remove the original htm file from source control and add it to .gitignore (add whole folder if possible, or individual files if not whole folder is converted)