-
Notifications
You must be signed in to change notification settings - Fork 1
add markdown file #101
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
base: master
Are you sure you want to change the base?
add markdown file #101
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { Span, Color, P, Div } from './elements.jsx' | ||
| import { css } from '../lib/dom.js' | ||
| import { NavLink } from '../component/header.jsx' | ||
| import { NavLink } from './header.jsx' | ||
|
||
|
|
||
| css(` | ||
| li.mli { | ||
| display:block; | ||
| } | ||
|
|
||
| .warn{ | ||
| outline:1px dashed red; | ||
| padding:0.8rem; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. padding en |
||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je pense qu'il faut eviter les noms de class css trop generique si elle ne sont pas scoper dans une classe parente plus specifique. |
||
|
|
||
| `) | ||
|
|
||
| export const MTitle = Object.fromEntries( | ||
| ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((el) => [ | ||
| el, | ||
| ({ children, ...props }) => | ||
| h( | ||
| el, | ||
| props, | ||
| <> | ||
| <Span fg="red">{'#'.repeat(Number(el.slice(1)))}</Span> | ||
| </>, | ||
| children, | ||
| ), | ||
| ]), | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tu peu pre-compute une partie du code: export const MTitle = Object.fromEntries(
['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((el) => {
const decoration = <Span fg="red">{'#'.repeat(Number(el.slice(1)))}</Span>
return [el, ({ children, ...props }) => h(el, props, decoration, children)]
}),
)Mais je pense que c'est encore mieu de le generer en css directement, comme c'est fait ici: https://github.com/egoist/hack/blob/master/src/css/markdown.css#L91-L105 |
||
|
|
||
| export const MItalicWord = ({ children, color, type }) => { | ||
| return ( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useless return, I do think a lot of this could be achieve with a class and |
||
| <P> | ||
| <Color.Orange>{'>'}</Color.Orange> | ||
| <Color.CommentLighter>*</Color.CommentLighter> | ||
| <Span fg={color} style={{ fontStyle: 'italic' }}> | ||
| {children} | ||
| </Span> | ||
| <Color.CommentLighter>*</Color.CommentLighter> | ||
| {type === 'ps' && <Color.Orange>{'<'}</Color.Orange>} | ||
| </P> | ||
| ) | ||
| } | ||
|
|
||
| export const MLi = ({ children, link }) => { | ||
| let ColorIze = link ? Color.CyanDarker : Color.CommentLighter | ||
| return ( | ||
| <NavLink class={`mli`} href={link ? link : null}> | ||
| <Span fg="orange"> - </Span> | ||
| <Span | ||
| style={{ | ||
| padding: '0.1rem', | ||
| background: !link && 'rgba(75, 75, 75, 0.63)', | ||
| textDecoration: link && 'underline', | ||
| }} | ||
| fg={link ? 'cyan-darker' : 'white'} | ||
| > | ||
| <ColorIze>{link ? '[' : '`'}</ColorIze> | ||
| {children} | ||
| <ColorIze>{link ? ']' : '`'}</ColorIze> | ||
| </Span> | ||
| </NavLink> | ||
| ) | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je suis pas convaincu de ce
et eviter un truc aussi specifique |
||
|
|
||
| export const Warning = ({ children }) => { | ||
| return <Div class="warn">{children}</Div> | ||
| } | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas sur que je trouve ca specialement intressant d'exporter ca plutot que de le copier / coller dans ce cas