Skip to content

Convert documentation definition lists to tables#15950

Merged
seanbudd merged 6 commits intobetafrom
convertDLtoTable
Dec 22, 2023
Merged

Convert documentation definition lists to tables#15950
seanbudd merged 6 commits intobetafrom
convertDLtoTable

Conversation

@seanbudd
Copy link
Copy Markdown
Member

@seanbudd seanbudd commented Dec 21, 2023

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.

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

Testing strategy:

Checked built output

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@seanbudd seanbudd requested review from a team as code owners December 21, 2023 00:26
@seanbudd seanbudd changed the base branch from master to beta December 21, 2023 00:26
@seanbudd seanbudd added this to the 2024.1 milestone Dec 21, 2023
seanbudd and others added 2 commits December 22, 2023 11:19
Co-authored-by: Michael Curran <mick@nvaccess.org>
@seanbudd seanbudd merged commit 68c24da into beta Dec 22, 2023
@seanbudd seanbudd deleted the convertDLtoTable branch December 22, 2023 00:47
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 seanbudd mentioned this pull request Jan 23, 2024
5 tasks
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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing description of options in user guide

3 participants