Convert documentation definition lists to tables#15950
Merged
Conversation
5 tasks
CyrilleB79
reviewed
Dec 21, 2023
seanbudd
commented
Dec 21, 2023
Co-authored-by: Michael Curran <mick@nvaccess.org>
michaelDCurran
approved these changes
Dec 22, 2023
5 tasks
seanbudd
added a commit
that referenced
this pull request
Jan 9, 2024
Closes #8734 Part of #15014 Related nvaccess/nvda-misc-deps#30, #16002, #15950, #15939, #15981 Summary of the issue: In order to migrate to Crowdin, we must convert txt2tags to markdown. In order transition safely, beta will build docs from t2t to markdown to html. Eventually the t2t will be removed and the markdown will become the source of truth. Description of user facing changes The user Guide no longer has numbered sections Translators and documentation writers now use extended markdown syntax rather than txt2tags. Description of development approach The build system performs certain pre-processing and post-processing when converting t2t to HTML. This equivalent system should be retained - i.e. the translator and documentation contribution experience should remain the same for markdown to HTML. Additionally, when converting t2t to markdown, new processing rules had to be created. There is no universal standard for custom anchors in markdown. As such text2tags doesn't have default rules for this. To retain our custom anchors, I added rules for a common markdown extended syntax. Similarly a shortcut is used for generating table of contents. See nvaccess/nvda-misc-deps#30 Setting the language code is done using the user_docs folder name, and the direction of RTL is manually set for the 3 current languages that require it, Persian, Arabic, Hebrew. Special Catalan processing for adding hreflang attributes is converted to a markdown extension syntax of {hreflang=en} The key commands file is generated using a custom made markdown python extension.
seanbudd
added a commit
that referenced
this pull request
Jan 24, 2024
Fixes #16063 Summary of the issue: #15950 converted definition lists to tables, however the conversion could have been done better. Both lines of the table start with header syntax || whereas it should only be the first header. Tables were previously converted from definition lists to look like this Default Enabled Options Default (Enabled), Enabled, Disabled Options should be listed before default logically. The first column should be headers, not the first row. Unfortunately there is no good support for column headers in markdown in our markdown parsing stack. As such, this can be improved by just having no headers. Description of user facing changes Change all option definition tables to be formatted as follows. The header row is hidden in CSS Options Default (Enabled), Enabled, Disabled Default Enabled Description of development approach The following regex was used: find: \|\|(.*)\|(.*)\|\n\|\|(.*)\|(.*)\| replace: || . {.hideHeaderRow} | . |\n|$3|$4|\n|$1|$2| Testing strategy:
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
Fixes nvaccess#14240 Summary of the issue: Definition lists are not exposed correctly in NVDA. They are also not supported in markdown natively. In order to convert text2tags to markdown, these must be converted to tables Description of user facing changes Definition lists are now tables in the user guide, which are exposed better by NVDA. The user guide standards have been updated to encourage the following format for documenting settings. The standards have been expanded to further document settings in a well structured manner. This is to improve readability, creating a simple standard to learn more about a settings documentation. This also allows for the future of automatically collating tables into a settings reference similar to key commands. Options Default (Enabled), Enabled, Disabled Default Enabled Toggle command nvda+shift+e Option Behaviour Enabled behaviour of enabled Disabled behaviour of enabled Description of development approach All t2t files had definition lists converted to markdown. The following regex was used to perform the conversion. To remove the definition list terminator : Find: ((^:.+\n .*\n)+): replace: $1 To replace rows: Find: ^: (.*)\n (.*)\n Replace: || $1 | $2 |\n
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
Closes nvaccess#8734 Part of nvaccess#15014 Related nvaccess/nvda-misc-deps#30, nvaccess#16002, nvaccess#15950, nvaccess#15939, nvaccess#15981 Summary of the issue: In order to migrate to Crowdin, we must convert txt2tags to markdown. In order transition safely, beta will build docs from t2t to markdown to html. Eventually the t2t will be removed and the markdown will become the source of truth. Description of user facing changes The user Guide no longer has numbered sections Translators and documentation writers now use extended markdown syntax rather than txt2tags. Description of development approach The build system performs certain pre-processing and post-processing when converting t2t to HTML. This equivalent system should be retained - i.e. the translator and documentation contribution experience should remain the same for markdown to HTML. Additionally, when converting t2t to markdown, new processing rules had to be created. There is no universal standard for custom anchors in markdown. As such text2tags doesn't have default rules for this. To retain our custom anchors, I added rules for a common markdown extended syntax. Similarly a shortcut is used for generating table of contents. See nvaccess/nvda-misc-deps#30 Setting the language code is done using the user_docs folder name, and the direction of RTL is manually set for the 3 current languages that require it, Persian, Arabic, Hebrew. Special Catalan processing for adding hreflang attributes is converted to a markdown extension syntax of {hreflang=en} The key commands file is generated using a custom made markdown python extension.
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
Fixes nvaccess#16063 Summary of the issue: nvaccess#15950 converted definition lists to tables, however the conversion could have been done better. Both lines of the table start with header syntax || whereas it should only be the first header. Tables were previously converted from definition lists to look like this Default Enabled Options Default (Enabled), Enabled, Disabled Options should be listed before default logically. The first column should be headers, not the first row. Unfortunately there is no good support for column headers in markdown in our markdown parsing stack. As such, this can be improved by just having no headers. Description of user facing changes Change all option definition tables to be formatted as follows. The header row is hidden in CSS Options Default (Enabled), Enabled, Disabled Default Enabled Description of development approach The following regex was used: find: \|\|(.*)\|(.*)\|\n\|\|(.*)\|(.*)\| replace: || . {.hideHeaderRow} | . |\n|$3|$4|\n|$1|$2| Testing strategy:
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #14240
Summary of the issue:
Definition lists are not exposed correctly in NVDA.
They are also not supported in markdown natively.
In order to convert text2tags to markdown, these must be converted to tables
Description of user facing changes
Definition lists are now tables in the user guide, which are exposed better by NVDA.
The user guide standards have been updated to encourage the following format for documenting settings.
The standards have been expanded to further document settings in a well structured manner.
This is to improve readability, creating a simple standard to learn more about a settings documentation.
This also allows for the future of automatically collating tables into a settings reference similar to key commands.
nvda+shift+eDescription of development approach
All t2t files had definition lists converted to markdown.
The following regex was used to perform the conversion.
To remove the definition list terminator
:((^:.+\n .*\n)+):$1To replace rows:
^: (.*)\n (.*)\n|| $1 | $2 |\nTesting strategy:
Checked built output
Known issues with pull request:
None
Code Review Checklist: