Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docsite: Generate sidebar from _sidebar.md #289

Merged
merged 6 commits into from
Mar 21, 2024
Merged

docsite: Generate sidebar from _sidebar.md #289

merged 6 commits into from
Mar 21, 2024

Conversation

juliaogris
Copy link
Member

@juliaogris juliaogris commented Mar 7, 2024

  • Generate sidebar from _sidebar.md.
  • Animate and style sidebar
  • Add header from _header.md file.

Sidebar generation

Generate sidebar from _sidebar.md file: Each .md file not prefixed with _
becomes a .html file, for example spec.md becomes spec.html. For each of
these HTML pages the navigation section on the left side has the contents of
the _sidebar.md file from the same directory as the original .md file.

The contents of _sidebar.md are taken as they are unless they are part of
a Markdown List where the first content of the list item is a relative link to
another markdown file. In that case the list item is expanded to the original link
followed by List of all level 2 and level 3 headings of that file nested within
each other. For example these _sidebar.md contents:

# Documentation

- [Language Specification](spec.md)
- [Built-ins](builtins.md)

become

# Documentation

- [Language Specification](spec.md)
	- [Syntax Grammar](spec.md#syntax-grammar)
		- [WSN Syntax Grammar](spec.md#wsn-syntax-grammar)
		- [Evy Syntax Grammar](spec.md#evy-syntax-grammar)
	- [Comments](spec.md#comments)
	- [Types](spec.md#types)
	- ...
- [Built-ins](builtins.md)
	- [Input and Output](builtins.md#input-and-output)
		- [print](builtins.md#print),
		- [read](builtins.md#read),
		- [cls](builtins.md#cls),
		- [printf](builtins.md#printf)
	- [Types](builtins.md#types)
 		- [len](builtins.md#len)
 		- [typeof](builtins.md#typeof)
 	- ...

Also add CSS styling in of expanded sidebar to this commit.
We will add logic to expand and collapse heading in follow-up commit.


https://evy-lang-stage--289-5dtwvsac.web.app/preview/

Closes evylang/todo#77

Generate sidebar from _sidebar.md file: Each *.md file not prefixed with `_`
becomes a *.html file, for example spec.md becomes spec.html. For each of
these HTML pages the navigation section on the left side has the contents of
the `_sidebar.md` file from the **same** directory as the original .md file.

The contents of `_sidebar.md` are taken as they are _unless_ they are part of
a Markdown List where the first content of the list item is a relative link to
another markdown file. In that case the list item is expanded to the original link
followed by List of all level 2 and level 3 headings of that file nested within
each other. For example these `_sidebar.md` contents:

	# Documentation

	- [Language Specification](spec.md)
	- [Built-ins](builtins.md)

become

	# Documentation

	- [Language Specification](spec.md)
		- [Syntax Grammar](spec.md#syntax-grammar)
   			- [WSN Syntax Grammar](spec.md#wsn-syntax-grammar)
   			- [Evy Syntax Grammar](spec.md#evy-syntax-grammar)
		- [Comments](spec.md#comments)
		- [Types](spec.md#types)
		- ...
	- [Built-ins](builtins.md)
		- [Input and Output](builtins.md#input-and-output)
   			- [print](builtins.md#print),
   			- [read](builtins.md#read),
   			- [cls](builtins.md#cls),
   			- [printf](builtins.md#printf)
		- [Types](builtins.md#types)
     		- [len](builtins.md#len)
     		- [typeof](builtins.md#typeof)
     	- ...

Also add CSS styling in of expanded sidebar to this commit.
We will add logic to expand and collapse heading in follow-up commit.

Commit-group: 1/2
Generate sidebar from _sidebar.md file: Each *.md file not prefixed with `_`
becomes a *.html file, for example spec.md becomes spec.html. For each of
these HTML pages the navigation section on the left side has the contents of
the `_sidebar.md` file from the **same** directory as the original .md file.

The contents of `_sidebar.md` are taken as they are _unless_ they are part of
a Markdown List where the first content of the list item is a relative link to
another markdown file. In that case the list item is expanded to the original link
followed by List of all level 2 and level 3 headings of that file nested within
each other. For example these `_sidebar.md` contents:

	# Documentation

	- [Language Specification](spec.md)
	- [Built-ins](builtins.md)

become

	# Documentation

	- [Language Specification](spec.md)
		- [Syntax Grammar](spec.md#syntax-grammar)
   			- [WSN Syntax Grammar](spec.md#wsn-syntax-grammar)
   			- [Evy Syntax Grammar](spec.md#evy-syntax-grammar)
		- [Comments](spec.md#comments)
		- [Types](spec.md#types)
		- ...
	- [Built-ins](builtins.md)
		- [Input and Output](builtins.md#input-and-output)
   			- [print](builtins.md#print),
   			- [read](builtins.md#read),
   			- [cls](builtins.md#cls),
   			- [printf](builtins.md#printf)
		- [Types](builtins.md#types)
     		- [len](builtins.md#len)
     		- [typeof](builtins.md#typeof)
     	- ...

Also add CSS styling in of expanded sidebar to this commit.
We will add logic to expand and collapse heading in follow-up commit.

Gen-command: make docs
Commit-group: 2/2
On all screens animate subsection expansion and collapse within sidebar.
Highlight current heading in sidebar, expand up until current heading or
current page if no subheading active (via anchor / URL hash).

On mobile slide sidebar in and out.

Commit-group: 1/2
On all screens animate subsection expansion and collapse within sidebar.
Highlight current heading in sidebar, expand up until current heading or
current page if no subheading active (via anchor / URL hash).

On mobile slide sidebar in and out.

Gen-command: make docs
Commit-group: 2/2
Parse _header.md file from the docs directory, used inside docs page header.
Update template and md tool.

Commit-group: 1/2
Parse _header.md file from the docs directory, used inside docs page header.
Update template and md tool.

Gen-command: make docs
Commit-group: 2/2
Copy link
Member

@camh- camh- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. So sorry about the delay in reviewing. 🍪

📗

@juliaogris juliaogris merged commit da453f6 into main Mar 21, 2024
3 checks passed
@juliaogris juliaogris deleted the sidebar branch March 21, 2024 04:21
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.

Rename sidemenu to sidebar in /play docsite: Add sidebar to docs
2 participants