Skip to content

Conversation

@le0tan
Copy link
Contributor

@le0tan le0tan commented Apr 11, 2020

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] Documentation update
• [X] Bug fix

Replaces #1145 #1187
Fixes #1104 Fixes #1071

What changes did you make? (Give an overview)

Move span generation to a plugin during build time. Add ::before to panel card containers to make navigation work properly on panel headers.

Provide some example code that this change will affect:

na

Is there anything you'd like reviewers to focus on?

Test if the panel functions are broken in any way.

Testing instructions:

na

Proposed commit message: (wrap lines at 72 characters)

To avoid dynamically injecting lots of dummy spans in a document with
many headings, let's generate these spans using a plugin, post
rendering.

To make anchor navigation function properly on panel headers, let's
introduce ::before element to card-container to make space for the
fixed top nav.

nbriannl and others added 30 commits February 26, 2020 11:48
The parser class houses a large number of functions.
This can be daunting for newer developers to the project, and decreases
maintainability of the code.

Let’s start by modularising the preprocess and url processing functions
into separate files.
Let’s also enhance some in-code documentation for these functions.
Some of these functions can also be abstracted into smaller units of
functionality, increasing the maintainability of the code.
The parsers MarkBind uses parses content in html tags as html
or markdown respectively.
This makes it difficult to add custom components that utilize
conflicting syntax.

Let’s add an interface to ignore content in certain special tags.
This interface is also exposed to plugins as the getSpecialTags option.
During live reload, changes to a source file rebuilds all files that are
dependent on it.

In addition, rebuilding all dependent source files slows the live reload
process, leading to a less pleasant user experience.

In addition, when running markbind serve, all pages are built and
rendered initially.
This significantly slows down the time to first page load, which can
be substantial when the number of source files is huge.

Let's implement lazy page building in these operations, which is opt-in
using the existing -o <file> or --one-page <file> flags for the markbind
serve command.

Changes to a source file will only rebuild pages that are dependent on
it, and is currently being viewed by the author. Other pages not being
viewed by the author are rebuilt when the author navigates to them.
In addition, only the landing page is built initially when serving.
Subsequent pages are built when the author navigates to them.
The user will have to try out how to add multiple features when using 
code blocks.

Let's add an example regarding how to use multiple features in code
blocks so that it's easier for the user to understand.
Let's convert <code> boxes to code blocks to better showcase the 
feature
* Update documentation on icon slot for boxes

* Update the examples for using icon slot for boxes.

* Resolve comments.
* Allow nunjucks that is called multiple times to support escaping for special tags

* Remove the need to prune raw tags, simplify logic of replacement

* Fix style and remove nested nunjucks escape test
The markdown-it parser used for attributes in components
uses a different set of plugins from the one used throughout markbind.

Let's unify the two variants to reduce the potential amount of
maintainence needed, and standardise the usable markdown
syntax throughout markbind.
Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@7.1.0...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
le0tan and others added 29 commits March 28, 2020 20:32
While pre-processing includes or panels, we have not yet resolved
the baseUrl of the src attribute.
This causes markbind to fail in finding the source file, since baseUrl
remains in the src attribute.

Let’s resolve the baseUrl for such cases first, allowing the user to use
the baseUrl attribute in include and panel src attributes.
MarkBind#990 removes ejs as a dependency
```
The hrefs of headings with angular brackets are incorrect because
markdown-it escapes the characters to "&lt;" and "&gt;" and the
subsequent slugify operation converts it to "and-lt" or "and-gt".

Let's fix this by removing the occurrences of the strings 
"&lt;" and "&gt;" before the slugify operation
```
Build is failing for commit 7ec7bc4 due to outdated versioning
Let us update tests
MarkBind currently runs js-beautify v1.7.5, although later versions
of the library have been released (the latest version as of this PR
is v1.10.3).

Let's upgrade js-beautify to the latest version.

Turning off js-beautify can improve the performance of MarkBind's 
build process. Let's also give the user the option to turn off js-beautify (whenever
necessary) through an option in site.json.
The diffing utilities used for functional tests only check for
differences in html files and the siteData json file.
Additionally, the diffs are whitespace and newline insensitive, which
can cause subtle, unintended changes to go unnoticed.

Let's expand the range of files to diff, using the isTextOrBinary
package as a first guard against diffing binary files.
Let's add additional constants that guard against binary files not
recognised by the package, or misrecognised as such.

Let's also change the diffing function used to be whitespace and
newline sensitive.
Since whitespaces and newlines now appear in the diffs, let's also
improve the diff printing utilities to account for it.
@le0tan le0tan closed this Apr 11, 2020
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.

Heading hidden when clicking pageNav Anchor navigation in panel not working properly with fixed header