-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Publish & Document Jinja Macros (#5342)
* Add macro install instructions to docs pages (#5330) * Update building-vanilla.md * Update pattern docs * Roll back pattern docs * Update building-vanilla.md * Add macros directory to published files * Rename hero macro * Rename tiered list macro * Update releases.yml * Document hero macro (#5325) * Add macro install instructions to docs pages (#5330) * Update building-vanilla.md * Update pattern docs * Roll back pattern docs * Update building-vanilla.md * Add macros directory to published files * Rename hero macro * Rename tiered list macro * Update releases.yml * End hero title and subtitle params with _text per new naming convention * Add html block comments to hero macro * Add hero macro docn * Add Hero macro import instructions * Add link to @pastelcyborg jinja macros installation guide * Fix hero title_text being renamed from rebase * Adjust jinja parameters column order * lowercase param types * adjust slots column ordering * Adjust slots is required per code review * Markup params table * Markup slots table * parameter & slot tables horizontally scroll rather than using mobile cards * Param/slot table widths set by percentage * More consistent whitespace control chars around jinja macro import * Revise hero element/description table word choice around title/substitle/description * comma-separated string with line breaks for hero layout type options * Update is required column by @bartaz Co-authored-by: Bartek Szopka <[email protected]> * Code review suggestions from @bartaz Co-authored-by: Bartek Szopka <[email protected]> --------- Co-authored-by: pastelcyborg <[email protected]> Co-authored-by: Bartek Szopka <[email protected]> * Rename hero macro * Document hero macro (#5325) * Add macro install instructions to docs pages (#5330) * Update building-vanilla.md * Update pattern docs * Roll back pattern docs * Update building-vanilla.md * Add macros directory to published files * Rename hero macro * Rename tiered list macro * Update releases.yml * End hero title and subtitle params with _text per new naming convention * Add html block comments to hero macro * Add hero macro docn * Add Hero macro import instructions * Add link to @pastelcyborg jinja macros installation guide * Fix hero title_text being renamed from rebase * Adjust jinja parameters column order * lowercase param types * adjust slots column ordering * Adjust slots is required per code review * Markup params table * Markup slots table * parameter & slot tables horizontally scroll rather than using mobile cards * Param/slot table widths set by percentage * More consistent whitespace control chars around jinja macro import * Revise hero element/description table word choice around title/substitle/description * comma-separated string with line breaks for hero layout type options * Update is required column by @bartaz Co-authored-by: Bartek Szopka <[email protected]> * Code review suggestions from @bartaz Co-authored-by: Bartek Szopka <[email protected]> --------- Co-authored-by: pastelcyborg <[email protected]> Co-authored-by: Bartek Szopka <[email protected]> * Update _index.scss * Update _index.scss * Add tiered list docs; minor formatting updates * File formatting fixes * Change "call to action block" to "CTA block" * Add cta block slot docs * Add code comments * Apply static widths to table columns * Add route for serving raw example template * Render flask template in HTML code snippet * Show rendered/raw example * Enable switching between Jinja code snippets and rendered HTML * Slight example.js docs improvements & refactors * Run prettier * RM example guide * Switch jinja example trigger from .js-show-template to [data-lang='jinja'] * Use raw query parameter instead of `/example` path * Syntax-highlight HTML within Jinja template macro calls * Optional chain to avoid possible null index error * Make HTML the default example language, instead of Jinja * Simplify example xmlhttprequest check * Change initializer keywords to `let` or `const` * Move throttle() to a utils function * fix HTML snippets including JS at the bottom * Revert "Move throttle() to a utils function" This reverts commit 75e51b8. * rename `createPreCode` param `hide` to `isHidden` * Reapply "Move throttle() to a utils function" This reverts commit 99b32c9. * swap xmlhttprequest for fetch() * Moved fetch code from example file into shared utils * Move utils to window scope, rather than JS import * prettier * set no-cache on raw template endpoint * Re-remove extracted utils functions * replace `let` with `const` where applicable * Additional try/catch handler in `fetchResponse()` * renderdropdown guard * promise.all parallelization improvement * rename `EXAMPLE_OPTION_CFG` to `EXAMPLE_LANGUAGE_OPTION_CONFIG` * Move HTML body extraction functions into `fetchHtmlSource()` and return them there instead of generating them in the callback * rename `fetchHtmlSource()` to `fetchRenderedHtml()` * Switch default example language from HTML to jinja if jinja is found * Clean up parallelization per code review * Prepare macros for release (bump to 4.17.0) * Move jinja macro API docs to bottom of hero/tiered list pages * Remove markup comments from hero macro output --------- Co-authored-by: pastelcyborg <[email protected]> Co-authored-by: Bartek Szopka <[email protected]>
- Loading branch information
1 parent
f831b0c
commit e2d9aa7
Showing
25 changed files
with
730 additions
and
198 deletions.
There are no files selected for viewing
This file contains 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,6 +1,6 @@ | ||
{ | ||
"name": "vanilla-framework", | ||
"version": "4.16.0", | ||
"version": "4.17.0", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Canonical Webteam" | ||
|
@@ -53,7 +53,8 @@ | |
"_index.scss", | ||
"/scss", | ||
"!/scss/docs", | ||
"!/scss/standalone" | ||
"!/scss/standalone", | ||
"/templates/_macros" | ||
], | ||
"devDependencies": { | ||
"@canonical/cookie-policy": "3.6.4", | ||
|
This file contains 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 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 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 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
8 changes: 4 additions & 4 deletions
8
templates/docs/examples/patterns/hero/hero-50-50-full-width-image.html
This file contains 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
8 changes: 4 additions & 4 deletions
8
templates/docs/examples/patterns/hero/hero-50-50-split-on-medium.html
This file contains 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 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 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 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
8 changes: 4 additions & 4 deletions
8
templates/docs/examples/patterns/hero/hero-signpost-full-width-image.html
This file contains 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 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-desktop-with-description-cta.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-desktop-with-description.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-desktop-with-list-item-cta.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-tablet-with-description.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-tablet-without-description.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/50-50-with-description.html
This file contains 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
4 changes: 2 additions & 2 deletions
4
templates/docs/examples/patterns/tiered-list/full-width-with-description.html
This file contains 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.