-
Notifications
You must be signed in to change notification settings - Fork 144
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
Page react component & catalog style #403
Comments
After a bit of digging, I think my problem could be resolved by obtaining access to the internal catalog react components. |
I don't think there's a real reason preventing us from exporting the page's building blocks. In the meantime, if you use the import React from 'react'
import { markdown } from 'catalog'
class SomeCatalogPage extends React.Component {
render() {
return markdown`
# Foo
`
}
}
export default SomeCatalogPage |
@herrstucki thx for your reply. It does solve one of my problem (inject arbitrary html). The second one is using loops in template, which isn't really allowed by this technique (md context is "lost" when inside a |
Do you have a concrete example of what you're trying to do? Then we can make sure that we'll cover it properly when we add these components. |
Sure, with the markdown literal, it would look like this (including a loop) :
But IMHO, adding a loop-system inside the md literal is a bad idea. As it would act as a template-engine, which we already have with react. |
I ended up building a custom webpack loader after looking at the |
* Allow arrays in markdown template literal Fixes #403 * Don't allocate unnecessary array
When trying to switch to "react pages" (from plain markdown), I noticed the generated page does not "inherit" css classes from
catalog
(eg:catalog-1ec5uok-h1-headingStyle
).Is it possible to give react component those css classes (and achieve "pixel perfect" compat' with markdown pages) ?
my (stripped) attempt :
index.js
The text was updated successfully, but these errors were encountered: