diff --git a/examples/gno.land/r/demo/markdown_test/markdown.gno b/examples/gno.land/r/demo/markdown_test/markdown.gno index 140005f643d..c6628f09d0c 100644 --- a/examples/gno.land/r/demo/markdown_test/markdown.gno +++ b/examples/gno.land/r/demo/markdown_test/markdown.gno @@ -178,15 +178,32 @@ It is a pity, but markdown does **not** work in here for most markdown parsers. Components ========== +Components are customized extended markdown markups that help you to enrich your content with more containers and styles. Components must be started with three colons ` + "`:::`" + `. As you'll see, some may be inline and other need a colon closing tag. Markdown components are rendered in plain HTML/CSS, meaning you can use only HTML with CSS classes to emulate these components, without using the extended markdown syntax. + Jumbotron component ------------------- A Jumbotron is a layout component used to showcase key messages. +_Using makdown:_ + +
` + ":::jumbotron" + ` +` + "your content" + ` +` + ":::/jumbotron" + ` ++ + +_Using HTML:_ + +
` + ":::stack" + ` +` + "your content" + ` +` + ":::/stack" + ` ++ +_Using HTML:_ + +
` + ":::box" + ` +` + "your content" + ` +` + ":::/box" + ` ++ + +_Using HTML:_ + +
` + ":::columns(2)" + ` + +` + ":::box" + ` +` + "your 1st col content" + ` +` + ":::/box" + ` + +` + ":::box" + ` +` + "your 2nd col content" + ` +` + ":::/box" + ` + +` + ":::/columns" + ` ++ + +_Using HTML:_ + +
` + ":::button(about, https://gno.land)/" + `+ +or + +
` + ":::button(Plain button)/" + `+ + + +_Using HTML:_ + + + +_Render:_ + :::button("Link button with comma, needs quotes", https://gno.land)/ :::button(Plain button)/ @@ -393,6 +482,22 @@ Accordions display a list of high-level options that can expand/collapse to reve *Todo: add argument to set the state at first (open or closed)* +_Using makdown:_ + +
` + ":::accordion(Accordion open/close button)" + ` +` + "Accordion content" + ` +` + ":::/accordion" + ` ++ +_Using HTML:_ + + +
Accordion content
+` + ":::tabs(1st tab button text, 2nd tab button text)" + ` + +` + ":::box" + ` +` + "1st tab content" + ` +` + ":::/box" + ` + +` + ":::box" + ` +` + "2nd tab content" + ` +` + ":::/box" + ` +` + ":::/tabs" + ` ++ +_Using HTML:_ + +
1st tab Content
+2nd tab Content
+` + ":::alert(warning)" + ` +` + "Warning content" + ` +` + ":::/alert" + ` ++ +_Using HTML:_ + +
Danger content
+` + ":::breadcrumb" + ` +` + "1. [Home](https://gno.land)" + ` +` + "2. [Foo](https://foo.land)" + ` +` + "3. [Bar](https://bar.land)" + ` +` + ":::/breadcrumb" + ` ++ +_Using HTML:_ + + + +_Render:_ + :::breadcrumb 1. [Home](https://gno.land) @@ -458,6 +636,29 @@ Dropdown component Dropdowns are toggleable, contextual overlays for displaying lists of links and more. It requires to be filled by a list and takes the dropdown text button as argument. +_Using makdown:_ + +
` + ":::dropdown(Dropdown - click here)" + ` +` + "- [Home](https://gno.land)" + ` +` + "- [Foo](https://foo.land)" + ` +` + "- [Bar](https://bar.land)" + ` +` + ":::/dropdown" + ` ++ +_Using HTML:_ + + + +_Render:_ + :::dropdown(Dropdown - click here) - [Home](https://gno.land) @@ -471,6 +672,27 @@ Pagination component Breadcrumbs is a navigation component that helps users navigate between website pages. It requires to be filled by an ordered list and can take the description of the navigation (for a11y purpose) as argument. +_Using makdown:_ + +
` + ":::pagination(Article pages)" + ` +` + "- [1](/)" + ` +` + "- [2](/)" + ` +` + "- [3](/)" + ` +` + ":::/pagination" + ` ++ +_Using HTML:_ + + + +_Render:_ + :::pagination(Article pages) - [1](/) @@ -487,6 +709,20 @@ This form component help you create forms. It has to be filled with dedicated co - First argument is the Action (eg. link: "https://gno.land") - Second argument is the Method (eg. "post", "get", ...) +_Using makdown:_ + +
` + ":::form(/, get)" + ` +` + "your form inputs" + ` +` + ":::/form" + ` ++ +_Using HTML:_ + + + +_Render (check bellow):_ + :::form(/, get) ### Form inputs components @@ -500,6 +736,20 @@ Input component is a component that is used to get user input in a text field. I You can insert text inside the component and it will be used as placeholder content. If not, you can use the shorthand component declaration by adding a "/" direclty after the arguments (see date input component declaration bellow). +_Using makdown:_ + +
` + ":::input(text, Label, Text)/" + `+
` + ":::input(number, Label, 10, 3)/" + `+ +_Using HTML:_ + +
` + ":::textarea(Label, Placeholder)/" + `+ +_Using HTML:_ + +
` + ":::check(radio, Radio Label)" + ` +` + "- [1](/)" + ` +` + "- [2](/)" + ` +` + "- [3](/)" + ` +` + ":::/check" + ` ++ +_Using HTML:_ + +
` + ":::select(Select Label)" + ` +` + "Select 1" + ` +` + "Select 2" + ` +` + "Select 3" + ` +` + ":::/select" + ` ++ +_Using HTML:_ + +
` + ":::action(submit, Submit)/" + `+ +_Using HTML:_ + + + +_Render:_ + :::action("reset", "Reset")/ :::action("submit", "Submit")/ diff --git a/gno.land/cmd/gnoweb/static/css/app.css b/gno.land/cmd/gnoweb/static/css/app.css index 2c9f24a7555..d5ad735c814 100644 --- a/gno.land/cmd/gnoweb/static/css/app.css +++ b/gno.land/cmd/gnoweb/static/css/app.css @@ -337,6 +337,8 @@ label > img { code { white-space: pre-wrap; + background: var(--code-background); + padding: 0.1rem 0.2rem; } /*** COMPOSITION ***/ .container {