-
Notifications
You must be signed in to change notification settings - Fork 379
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
Proposal: extend markdown rendering #439
Comments
Some interpreters cannot read the lang properly if it's not immediately followed by a space or a new line, so eventually I would suggest to use attributes, which is more widely accepted and in addition gives more flexibility. For instance :
About warnings and errors, the triple colons is also something widely used to create colored containers/boxes around labels. For instance :
|
About your comment on the other PR: #463 (comment) We'll do some server-side parsing, but no HTML server-side rendering. The goal is to make something that:
|
What is the context of applying markdown? I'm trying to understand what May I recommend taking a more async approach in issues that are (excessively) expressive in their context so that outside collaborators can be more helpful? |
Looks like a good fit for #408 :) |
Can be useful for testing: https://staging.gno.land/r/demo/markdown_test |
Considering the fact the rendering is done by the client, I would opt for a javascript approach. So, it would be possible to generate the UI without need of any backend templating system. The ideal solution should also let the content to be readable when the javascript engine is disabled in the browser. Two kind of (related) approches come in my mind to enhance the markdown: 1. Markdown shortcodesShortcodes could be used like in SSG solutions (let's say Hugo) in order to add more complexes UIs to the classic markdown. It’s also a good solution to avoid getting too much HTML/CSS in Markdown files and improve the DRY principles by reusing piece of code. Here is an example from an old project in Hugo:
The last part 2. MDX renderingVery similar to shortcodes, Mdx is an extended
Update@tbruyelle reminds me that marked.js, the library we use may offer many ways to create or develop these kinds of system above (by using or writing extensions). Using what we currently have is a good choice for a minimalist approach and we should avoid to reinvent the wheel when it's possible. |
Finding the right balance between readability and staying standard can be a challenge. To ensure the best user experience, it is important to explore alternative ways to manage HTML forms that are both easy to read and adhere to standards. For instance, a multi-column support could be implemented using To further improve readability, I suggest focusing on defining the minimal CSS necessary to create the most essential new widgets. Additionally, I propose continuing my initiative of creating a Once we have made the initial modifications, we can move on to more advanced alterations to finish the task. |
With the goal of creating a small library of pure CSS components. Here is a list of basic components we should incorporate. They are highly inspired by Notion components (meaning we they are simple inline block components), from Bootstrap classes and from the Gno.land 2.0 website Figma file (clean design). Of course we will be able to more later.
In addition to these components, others style config could be added such as: breakpoints (media queries) or reboot css (reset style). Other design systems such as composition and utility style can be achieved by using CubeCSS Principles : Simplicity, Progressive Enhancement, Agnostic patterns. |
Great, I suggest providing a quickstart in your preferred format so that we can review and discuss the approach. Please let me know if you require assistance setting up your environment, and feel free to reach out for early review. My goal is to facilitate your work so that we can move in the right direction with ease. Edit: In addition to widgets, some common rules may also be necessary, such as:
|
@moul We had a discussion with @alexiscolin and we decided to work on this next week. Thanks for your the additional rules, I think they are important ones and they shouldn't be hard to implement, so it's probably a good start. |
Proposal for a markdown convention to support columns without extending markdown while maintaining an acceptable representation on standard markdown renderers: The concept is to establish a way to indicate "start columns mode" and "stop columns mode." I have chosen It also takes a stance on not asking "how many columns" and instead defaults to 3 columns for gnoweb. We can expect a smarter approach when there are fewer than 3 columns, such as using a 50/50 layout for 2 columns or no columns when there is only one. # my awesome realm
hello world.
## subtitle
blah blah
- a
- b
- c
>>> hello, i'm an alert
---
### col 1
lorem ipsum
- a
- b
- c
### col 2
lorem ipsum
### col 3
lorem ipsum
### col 4
lorem ipsum
---
and here is a footer
<gno-playground> Example with GitHub default renderermy awesome realmhello world. subtitleblah blah
col 1lorem ipsum
col 2lorem ipsum col 3lorem ipsum col 4lorem ipsum and here is a footer An alternative idea is to consider that "H4," "H5," or any sufficiently deep heading can serve as a column. This way, we wouldn't need |
Context
Currently, we embrace markdown, which is the default way to consume a smart contract using the
Render
function and the official website.I propose extending markdown, so we preserve its main advantage -> being human-readable. But making it easier to programmatically interact with the contracts in richer ways.
Current state
Right now we can have rich rendering for humans with standard markdown.
New feature examples
Using frontmatter
Not a big fan of this approach, but it's interesting to show how other systems extended markdown.
On most markdown-driven static website generators, the engines are using frontmatter to allow writing context as yaml.
Adding metadata to JSON
We can add additional parameters to the language selector after the triple-backticks. We could use this to help machines understand the goal of each JSON entries.
Which would give valid markdown on a standard editor, but would allow the default gnoland website to generate a dynamic HTML form, and would allow a wallet to make dynamic sections too.
We could imagine things like:
Conclusion
My proposal is to extend markdown in a way that stays compatible with standard markdown renderer, and remains human-readable-first, but provides more context to machines and systems.
If we decide a system like this, then we could:
p/demo/dom
.Related with #903
The text was updated successfully, but these errors were encountered: