![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@fullstackio/cqmd
Advanced tools
cqmd is a markdown preprocessor that parses cq query blocks and replaces them with "regular" markdown code blocks.
$ npm install --global @fullstackio/cqmd
$ cqmd --path <path/to/code/basepath> <input-markdown-file>
# or
$ cat file | cqmd --path <path>
To use cqmd
you write a normal markdown file but instead of using indented code blocks you use the following syntax:
{lang=myLang,crop-query=myQuery,format=myFormat}
<<[](path/to/file.js)
For example, say we have a file examples/basics.js
with the following code:
// examples/basics.js
const bye = function() {
return 'bye';
}
bye(); // -> 'bye'
let Farm = () => 'cow';
In our markdown file we could include the code block by using the following markdown:
// document.md
And here is how we say goodbye:
{lang=javascript,crop-query=.bye,format=gfm}
<<[](examples/basics.js)
Isn't that neat?
Notice that none of the values are quoted. You do not quote your crop-query. If you use quotes then you are searching for a string.
Now we can process document.md
like so:
$ cqmd --path . document.md
Which emits:
// document.md
And here is how we say goodbye:
```javascript
const bye = function() {
return 'bye';
}
```
Isn't that neat?
You can see the full list of possible queries in the cq manual.
var cqmd = require('@fullstackio/cqmd').default;
cqmd(input, {path: __dirname}).then(function(results) {
console.log(results);
});
If you'd like to create a custom formatting function, use the format
key in the options.
crop-start-line
blocksPlease feel free to submit pull requests!
Originally written by Nate Murray.
This repo was written and is maintained by the Fullstack React team. If you're looking to learn React, there's no faster way than by spending a few hours with the Fullstack React book.
FAQs
markdown pre-processor for cq
The npm package @fullstackio/cqmd receives a total of 6 weekly downloads. As such, @fullstackio/cqmd popularity was classified as not popular.
We found that @fullstackio/cqmd demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.