Upgade CodeBlock#109
Open
AlexBlack788 wants to merge 1 commit into
Open
Conversation
New features: added two fields at the top of CodeBlock: start_line_numbers_at and highlight_lines_extra. Logic of the field start_line_numbers_at is as follows: 1. The field accepts integer values - fractional values will be converted to integer values, non-numeric values - discarded. 2. The value specified in the field controls the enable_line_numbers_at field as follows: 2.1 The positive value sets enable_line_numbers="true". 2.2 A negative value sets enable_line_numbers="false", the value of start_line_numbers_at will also be specified and become positive. 2.3 An uninstalled (undefined) value sets enable_line_numbers="false". Logic of highlight_lines_extra field operation is as follows: 1. The field accepts a single integer value or a set of integer values separated by a comma - fractional values will be converted to integers, not numeric values - discarded. 2. The field is automatically recalculated when you switch to Prosemirror editor or preview from Prosemirror editor. 3. If a set of values is specified in the field, they will be sorted in ascending order. 4.The possibility to specify "relative" values has been implemented - i.e. if, for example, we have a certain piece of code, the numbering of which starts with 37 lines, and we need to highlight the 53rd and 68th lines of code, then in the field we type: "53,68" (without quotes). In the standard DokuWiki editor we will still have absolute values. 5. The ability to specify "absolute" values, as implemented in the standard DokuWiki editor is also saved - for this we specify negative values. I.e. to highlight, for example, 4 and 7 code stacks, no matter from which line our code begins to number - specify in the field: "-4,-7" (without quotes). 6. If the field start_line_numbers_at is not specified, the numbering will be the same as in the standard DokuWiki editor, i.e. starting with 1.
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.
New features: added two fields at the top of CodeBlock:
start_line_numbers_atandhighlight_lines_extra.Logic of the field
start_line_numbers_atis as follows:enable_line_numbers_atfield as follows:2.1 The positive value sets
enable_line_numbers="true".2.2 A negative value sets
enable_line_numbers="false", the value of start_line_numbers_at will also be specified and become positive.2.3 An uninstalled (undefined) value sets
enable_line_numbers="false".Logic of
highlight_lines_extrafield operation is as follows:4.The possibility to specify "relative" values has been implemented - i.e. if, for example, we have a certain piece of code, the numbering of which starts with 37 lines, and we need to highlight the 53rd and 68th lines of code, then in the field we type: "53,68" (without quotes). In the standard DokuWiki editor we will still have absolute values.