-
Notifications
You must be signed in to change notification settings - Fork 7
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
Migrate to new AsciiDoc renderer #95
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
license-eye has totally checked 139 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
86 | 2 | 51 | 0 |
Click to see the invalid file list
- app/components/AsciidocBlocks/Footnotes.tsx
- app/utils/asciidoctor.tsx
|
||
export const ui = tunnel() | ||
|
||
const CustomDocument = ({ document }: { document: AdocTypes.Document }) => { |
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.
Nice to move most of this out into shared code in @oxide/design-system
– since we use the ToC on the docs site also.
node: AdocTypes.Block | AdocTypes.Inline | ||
hasLightbox?: boolean | ||
}) => { | ||
const InlineImage = ({ node }: { node: Block | Inline }) => { |
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.
Inline elements we cannot use the custom renderer unfortunately. So this is formatted like a regular AsciiDoc converter function. Inline images appear in places like table cells.
<div className="content"> | ||
<pre className={cn('highlight', nowrap ? ' nowrap' : '')}> | ||
{lang && lang === 'mermaid' ? ( | ||
<Mermaid content={decode(content)} /> | ||
<Mermaid content={node.source || ''} /> |
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.
We have a custom Listing
converter here because we want to render the Mermaid elements. I tried moving this into the shared design system library, but it was unhappy with the Mermaid import even when it was set as a peer dep.
* renderWithBreaks('/path/to/long/file.txt') | ||
* '/<wbr/>path/<wbr/>to/<wbr/>long/<wbr/>file.txt' | ||
*/ | ||
export const renderWithBreaks = (text: string): string => { |
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.
This is all moved into the shared lib too now.
|
||
import Mermaid from './Mermaid' | ||
|
||
// Custom highlight.js language definition to support TLA+ | ||
// Reference: https://github.com/highlightjs/highlight.js/pull/1658 | ||
hljs.registerLanguage('tla', function (hljs) { |
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.
TLA support needs be readded
baseConverter: Html5Converter | ||
|
||
constructor() { | ||
this.baseConverter = new InlineConverter() |
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.
This now builds on top of the custom inline converter in the design system – which itself is based on the default HTML5 converter. This is for inline conversions where the AST processor doesn't reach.
Following suit from docs and marketing site updates.
Also now using a bunch of shared AsciiDoc handling stuff from the design system to reduce duplication across the sites. Specifically on processing / handling / syntax highlighting.