-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add first working prototype #1
Conversation
3e10510
to
b8c3b40
Compare
b8c3b40
to
f69b4d9
Compare
describe: "Output file", | ||
type: "string" | ||
}), | ||
argv => { |
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.
You can destructure argv
here directly for extra street cred
const om = toOM(parse(inputString)); | ||
const outputString = renderToStaticMarkup(React.createElement(Document, om)); | ||
if (output) fs.writeFileSync(output, outputString); | ||
// tslint:disable-next-line:no-console |
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.
Perhaps the no-console
rule of TSLint isn't very appropriate for a CLI
export function Ref({ idRef }: RefOM) { | ||
const section = idRef.target; | ||
if (section) return <a href={"#" + section.id}>{section.title}</a>; | ||
else return <strong>???</strong>; |
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.
You could add a title
attribute for better UX
return ( | ||
<section id={id}> | ||
<h1> | ||
{counter.join(".")} {toReact(title)} |
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.
Omg how horrible to not put a dot at the end
import { SectionOM } from "./SectionOM"; | ||
import { StrongOM } from "./StrongOM"; | ||
|
||
export type OM = DocumentOM | SectionOM | ParagraphOM | EmphasisOM | StrongOM | RefOM; |
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 could perhaps all be in one file
No description provided.