Skip to content

Conversation

@ramseycoder
Copy link
Collaborator

create a markdown utility file for hep in design

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 2, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b41f393
Status: ✅  Deploy successful!
Preview URL: https://4782a3fb.platform-nan-dev-8sl.pages.dev

View logs

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { NavLink } from '../component/header.jsx'
import { NavLink } from './header.jsx'

?? ce code compile ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faut eviter autan que possible de lier les components entre eux, le headers doit pas creer des components generique reutiliser par markdown.jsx

.warn{
outline:1px dashed red;
padding:0.8rem;
}
Copy link
Member

Choose a reason for hiding this comment

The 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.

children,
),
]),
)
Copy link
Member

Choose a reason for hiding this comment

The 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 (
Copy link
Member

Choose a reason for hiding this comment

The 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 :before :after elements too

</Span>
</NavLink>
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je suis pas convaincu de ce MLi, tu devrais le decouper en 3 components:

  • Les LI
  • Les Liens
  • Le text

et eviter un truc aussi specifique

.warn{
outline:1px dashed red;
padding:0.8rem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding en rem ca va pas gerer que l'allignement reste sur la grille de characters monospace (mode text quoi)


// prettier-ignore
const NavLink = (props) => <li> - <Link {...props} /></li>
export const NavLink = (props) => <li> - <Link {...props} /></li>
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants