Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
node_modules
package-lock.json
dist/remarkdown-custom.css
*.tgz
*.tgz
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": false,
"useTabs": true
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2011–2020 Florens Verschelde
Copyright © 2011–2026 Florens Verschelde

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@

# ReMarkdown

ReMarkdown is a stylesheet that makes HTML look like raw Markdown text.
Take a look at the [online demo and documentation](https://fvsch.github.io/remarkdown/).
ReMarkdown styles HTML to look like plain Markdown text.

- [online demo and docs][docs]
- [npm: remarkdown.css][npm]

Markdown is [a plain-text syntax by John Gruber](https://daringfireball.net/projects/markdown/). This project also takes inspiration from variants such as PHP Markdown Extra and GitHub Flavored Markdown.
Markdown is [a plain-text syntax by John Gruber][markdown]. Some styles are inspired by [PHP Markdown Extra][md-extra] and [GitHub Flavored Markdown][md-gfm].

## Documentation

- [Using ReMarkdown](https://fvsch.github.io/remarkdown/)
- [Available styles](https://fvsch.github.io/remarkdown/styles.html)
- [Customizing ReMarkdown](https://fvsch.github.io/remarkdown/customize.html)
- [Using ReMarkdown][docs]
- [Available styles][styles]
- [Customizing ReMarkdown][customize]


[npm]: https://www.npmjs.com/package/remarkdown.css
[docs]: https://fvsch.github.io/remarkdown/
[styles]: https://fvsch.github.io/remarkdown/styles.html
[customize]: https://fvsch.github.io/remarkdown/customize.html
[markdown]: https://daringfireball.net/projects/markdown/
[md-extra]: https://michelf.ca/projects/php-markdown/extra/
[md-gfm]: https://github.github.com/gfm/
33 changes: 33 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { access, constants, writeFile } from "node:fs/promises"
import { join } from "node:path"
import * as prettier from "prettier"
import * as sass from "sass"

const sources = [
["preset/remarkdown.scss", "dist/remarkdown.css"],
["preset/remarkdown.attr.scss", "dist/remarkdown.attr.css"],
["preset/remarkdown-zero.scss", "dist/remarkdown-zero.css"],
["preset/remarkdown-zero.attr.scss", "dist/remarkdown-zero.attr.css"],
["docs/demo.scss", "docs/demo.css"],
]

sources.forEach(buildStylesheet)

async function buildStylesheet([sourceFilename, outFilename]) {
const sourceFile = join(import.meta.dirname, sourceFilename)
const outFile = join(import.meta.dirname, outFilename)

try {
await access(sourceFile, constants.R_OK)
} catch {
console.error(`Missing file ${sourceFile}`)
return
}

const compiled = await sass.compileAsync(sourceFile)
const prettified = await prettier.format(compiled.css, {
parser: "css",
})
await writeFile(outFile, prettified)
console.log(`${sourceFilename} -> ${outFilename} (${prettified.length} B)`)
}
Loading