Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
rebber is a LaTeX stringifier for remark
Starting from version 8.0.0, remark
dropped support for footnotes; hence, rebber
also dropped it's support starting from version 6.0.0.
Therefore, we have the following compatibility table for remark-rebber versions:
remark | rebber |
---|---|
< 8.0.0 | < 6.0.0 |
> 8.0.0 | any |
npm:
npm install rebber
const unified = require('unified')
const remarkParser = require('remark-parse')
const rebber = require('rebber')
const {contents} = unified()
.use(remarkParser)
.use(rebber)
.processSync('### foo')
console.log(contents);
Yields:
\section{foo}
toLaTeX(node[, options])
Stringify the given MDAST node.
options.overrides
Overrides are named that way because they can override any MDAST node type to latex stringifier. Their other use is to use custom latex stringifier for custom MDAST node type.
Examples:
const {contents} = unified()
.use(remarkParser)
.use(remarkFoobarElementsParser) // creates MDAST nodes of type 'foobar'
.use(rebber, {
overrides: {
// override rebber's method to turn MDAST link nodes into latex
link: require('./your-own-link-latexifier')
// tell rebber what to use to turn MDAST foobar nodes into latex
foobar: require('./your-foobar-latexifier')
}
})
options.<mdastNodeType>
MDAST nodes are stringified to LaTeX using sensible default LaTeX commands. However, you can customize most of the LaTeX command corresponding to MDAST nodes. Here are documented the function signatures of these customizable commands. Note that the keys of the options
object are named after the corresponding MDAST node type.
For example, by default, ![](/foo.png)
will get compiled to \includegraphics{/foo.png}
.
Setting
options.image = (node) => `[inserted image located at "${node.url}"]`
will stringify our example Markdown to [inserted image located at "/foo.png"]
instead of \includegraphics{/foo.png}
.
options.blockquote
(text) => ``,
options.break
() => ``,
options.code
(textCode, lang) => ``,
options.definition
(options, identifier, url, title) => ``,
options.footnote
(identifier, text, protect) => ``,
options.footnoteDefinition
(identifier, text) => ``,
options.footnoteReference
(identifier) => ``,
options.headings
[
(text) => ``, // level 1 heading
(text) => ``, // level 2 heading
(text) => ``, // level 3 heading
(text) => ``, // level 4 heading
(text) => ``, // level 5 heading
(text) => ``, // level 6 heading
(text) => ``, // level 7 heading
],
options.image
(node) => ``,
options.link
(displayText, url, title) => ``,
options.linkReference
(reference, content) => ``,
options.list
(content, isOrdered) => ``,
options.listItem
(content) => ``,
options.text
(text) => ``,
options.thematicBreak
() => ``,
options.table
(ctx, node) => ``,
To ensure a flexible rendering, longtabu
environment is used by default.
Table stringification can be configured with some advanced options:
options.spreadCell
spread 0pt
Customize cells spacing (usually done using the spread
command).
Common commands are spread <dimension>
(add <dimension>
as spacing ) or to <dimension>
(fix the overall width of table).
Default value is spread 0pt
(natural spacing).
options.firstLineRowFont
'\\rowfont[c]{\\bfseries}'
Customize the first line font (this is useful when your tables always have a header as first line).
Default value is '\\rowfont[c]{\\bfseries}'
(bold, center aligned).
options.defaultOtherLineRowFont
'\\rowfont[l]{}'
Customize table font for all lines except the first.
Default value is '\\rowfont[l]{}'
(normal font, left aligned).
options.headerParse: (tableRows) => ''
(tableRows) => ''
Cunction that computes the "latex header" part of the table environment, this generates strings such as |c|c|r|
.
It gets an array of all the tableRow
mdast nodes for the table as argument.
Default function extracts the number of columns for each row and uses the X[-1]
handler ("find the best available width").
The result for a 3 column-table is |X[-1]|X[-1]|X[-1]|
.
rebber-plugins
FAQs
Stringifies MDAST to LaTeX
The npm package rebber receives a total of 50 weekly downloads. As such, rebber popularity was classified as not popular.
We found that rebber demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.