-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Markdown to HTML rendering #36
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
Draft
validcube
wants to merge
60
commits into
LawnchairLauncher:master
Choose a base branch
from
validcube:bubbletea-milestone
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
d4a730d
feat: Markdown processor
validcube 006b823
Remove markdown parser from html during static generation
validcube e3362ad
docs: Update docs
validcube 84114f4
Apply suggestions from code review
validcube b15c25c
feat: Use yaml frontmatter and remove client rendering
validcube cf2a1f1
feat: Make it directly commit to the codebase
validcube 47fc017
chore: Commit pregenerated html file
validcube de7e540
chore: Remove deprceated functions
validcube acd82d4
chore: Faster build
validcube 8640304
refactor: Split them into multiple files because performance is not a…
validcube 52de0da
fix: Don't remove data attribute for author freshness
validcube 03da5bd
chore: Update authors roles
validcube 50db830
chore: Add metadata to html
validcube d2b8b51
feat: Create html template automatically when none is specified
validcube fe96626
docs: Update docs
validcube 4708ec5
feat: Support for codeblock highligher and GFM footnote
validcube 6b887d9
refactor: Much better code highlight
validcube 71a6ec5
feat: Update sitemap and feed.xml
validcube b871ca4
blargh
validcube 21a92dc
Update feed and blog index, and html
validcube a0b6813
feat: Theme GFM table
validcube 615d2e6
Fix admonition icon not loaded or not impl
validcube 6d3d71c
re add faq schema
validcube 53398b7
chore: date in UTC
validcube 09d5aa6
fix: Escape value with LC-FM
validcube 7b18a2e
chore: date in UTC
validcube 8bbbf65
fix: Unique slug even for duplicate
validcube 286eaed
chore: Remove social from author metadata
validcube 06e2b02
Insert toc with heading
validcube 7b4f08c
chore; Update HTML output
validcube e0c7e5b
feat: Handle more CM/GFM testing case
validcube ece24db
chore: Conflict
validcube cefc8cd
fix: Import Google Sans Code instead
validcube d99d524
fix: inline code being too close to the text
validcube 4a41f63
fix: Inline/Block code consistency colour
validcube 5aa27c3
fix: Blockquote without themes
validcube fa40b53
fix: Admonition sit too close to eachother
validcube 670c54a
fix: Don't let user select decorative symbols from material
validcube 92c832a
chore: Roll common css to v6
validcube 0cae04c
chore: Roll CSS/Script to v6
validcube 8c09b58
docs: Much better docs
validcube 577ebe9
docs: Clarify
validcube a947b05
feat: Lawnchair deeplinking test
validcube f2761dc
Merge remote-tracking branch 'upstream/master' into bubbletea-milestone
validcube b099c48
chore: Update script
validcube 053f521
feat: Update generated structure
validcube adf2768
fix: Remove frontmatter key normalisation
validcube 026969e
fix: Don't read markdown inefficienyl
validcube 1e25fbd
fix: Remove dups utils
validcube 72a9b1a
refactor: js
validcube 9c42d9a
ci: Update checkout
validcube 407e0d3
Potential fix for pull request finding
validcube 687c518
feat: Update pregenerated structure
validcube 365c7f7
chore: Update minimum requirements
validcube f4d22cf
feat: Show toc on demand
validcube 1ada253
feat: Update template structure
validcube 2d62cc5
fix: Lawnstate reflection
validcube f2b9fb1
feat: Use samaller code styling on standalone
validcube ac0fb19
feat: Create FAQ
validcube 47e0f55
chore: Remove test mode
validcube File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Lawnchair Website | ||
|
|
||
| Welcome to Lawnchair contributing guidelines, this guide primarily focus on writing blogs/documentations to the website. | ||
|
|
||
| ## Prerequisite | ||
|
|
||
| - Node runtime, at least Bun 1.3.0 or at least Node.js 20.19 | ||
| - Node dependencies (`npm i` or `npm ci` for CI environment) | ||
|
|
||
| ### Write from Markdown to HTML | ||
|
|
||
| 1. Setup page directory | ||
| Write your blog in markdown with [metadata](#metadata), create a folder inside `blog` and place it there. | ||
|
|
||
| 2. Build RSS feeds, sitemap and blog index, and your HTMLified markdown | ||
| Run `npm run build` to generate a sitemap, RSS feeds, blog selector and your HTMLified version of your markdown. | ||
|
|
||
| 3. Update live information (optional) | ||
| If you wish to signal to every Lawnchair client using live information announcement feature, add your entry to `live-information.json`. | ||
|
|
||
| #### Custom components | ||
|
|
||
| Lawnchair markdown renderer extends the current CommonMark specifications with these components: | ||
| * Lawnchair frontmatter | ||
| * Inline Table of Contents (ToC) at any location with `<toc-inline></toc-inline>` (**inline ToC need compatible pages**, user override can disable toc globally by adding `?disabletoc=*` to the url param) | ||
| * Admonitions: Quote block starting with `> [!TIP/NOTE/IMPORTANT/WARNING/CAUTION]` [(same as GitHub-flavored alerts)](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) | ||
|
|
||
| ##### Metadata | ||
|
|
||
| ###### Frontmatter | ||
|
|
||
| If your markdown has frontmatter with `title` and `description`, they will be automatically used for the page's `<title>` and meta description. Otherwise, `{{title}}` and `{{description}}` placeholders remain for you to fill in manually. | ||
|
|
||
| Blog index, sitemap and RSS feed is automatically updated with blog entries using `last_modified` (default to `first_published`) or `first_published` (default to today) from frontmatter, for RSS feed the `title` and `description` will be omitted if none is specified. | ||
|
|
||
| ```yaml | ||
| --- | ||
| title: strings | ||
| description: strings | ||
| authors: | ||
| - array1 | ||
| - array2 | ||
| first_published: YYYY-MM-DD | ||
| last_modified: YYYY-MM-DD | ||
| --- | ||
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > Date is always assumed in Central UTC+0/GMT-0 time | ||
|
|
||
| > [!WARNING] | ||
| > The script generates the h1 heading and description paragraph from `title` and `description` for you, | ||
| > so you should **not** include a duplicate `# Heading title` in your markdown content. | ||
| > | ||
| > Authorship cards and `first_published` `last_modified` metadata are positioned below the generated title and description. | ||
|
|
||
| ##### Authorship | ||
|
|
||
| Required when you specified an author in Frontmatter. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "authors": [ | ||
| { | ||
| "id": "generic", | ||
| "name": "Lawnchair Launcher Team", | ||
| "role": "Administrator", | ||
| "avatar": "/images/lawnchair.png", // Optional, supports URLs and local assets, and will not show an avatar when not specified | ||
| "links": { // Optional, will not show any social icon when not specified | ||
| "github": "https://github.com/lawnchairlauncher", | ||
| "x": "https://x.com/lawnchairapp", | ||
| "mastodon": "https://mastodon.social/@lawnchairapp" | ||
| /* To add your own socials, | ||
| search for iconMap in scripts/components/author-cards.js | ||
| and configure it so that icon will render correctly for your socials */ | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| #### Testing | ||
|
|
||
| To test the rendering of standards from CommonMark (CM), GitHub-Flavored Markdown (GFM), Lawnchair Frontmatter (LC-FM). | ||
|
|
||
| Copy the `/scripts/test-blog` to `/blog` folder and build the documents to preview suite of test case. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| .vscode/settings.json | ||
| node_modules/ | ||
| blog/test-blog/ | ||
| .idea/ |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.