Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
codegrid-markdown
Advanced tools
Readme
CodeGrid-specified markdown processor.
npm i codegrid-markdown
var CodeGridMarkdown = require('codegrid-markdown');
var CGMDRenderer = new CodeGridMarkdown({
// options for marked
});
var str = fs.readFileSync(__dirname + '/cg.md', 'utf-8');
var htmlStr = CGMDRenderer.render(str);
cgmd ./path/to/your.md
# or
cgmd ./path/to/your.md -o ./path/to/your.html
# can also
cgmd '# foo'
Browserifyから利用する場合、ブラウザ環境でも利用可能です。
この2パターンの拡張があります。
cgmdパターンは、通常のMarkdownの中に混ぜて書くことができ、[foo]通常のMarkdownテキスト[/foo]
の形式で記述します。
[note]
#### 注釈タイトル
注釈本文
[/note]
↓
<div class="Note">
<h1 id="-">注釈タイトル</h1>
<p>注釈本文</p>
</div>
[column]
#### コラムタイトル
コラム本文
[/column]
↓
<div class="Column">
<h1 id="-">コラムタイトル</h1>
<p>コラム本文</p>
</div>
[demo]
# DEMOタイトル
<iframe src="http://example.com/demo.html"></iframe>
[/demo]
↓
<section class="CG2-livecode">
<header class="CG2-livecode__header">
<div class="CG2-livecode__label">
DEMOタイトル
</div>
<div class="CG2-livecode__nav">
<ul>
<li>
<a href="http://example.com/demo.html" target="_blank">
<span class="CG2-icon-tool"></span> 新規タブで開く
</a>
</li>
</ul>
</div>
</header>
<div class="CG2-livecode__body">
<iframe src="http://example.com/demo.html"></iframe>
</div>
</section>
クリックで再生モードにしたい場合。
[demo]
# DEMOタイトル
<iframe data-src="http://example.com/demo.html" data-deferred="data-deferred"></iframe>
[/demo]
ソースコードへのリンクが欲しい場合。
[demo]
# DEMOタイトル
[ソースコード](http://example.com)
<iframe src="http://example.com/demo.html"></iframe>
[/demo]
[imgbox]
#### 画像タイトル
画像の説明
![画像alt](http://example.com/image.png)
[/imgbox]
↓
<div class="ImgBox">
<h1 id="-">画像title</h1>
<p>画像の説明</p>
<p><img src="http://example.com/image.png" alt="画像alt"></p>
</div>
[tree]
#### ファイルツリー
- src/
- styles/
- base.css
- **components/**
- **a-lot-of-files/**
[/tree]
<div class="Free">
<h4>ファイルツリー</h4>
<ul>
<li class="directory">
<details>
<summary>src/</summary>
<ul>
<li class="directory">
<details>
<summary>styles/</summary>
<ul>
<li class="file" data-file-type="css">base.css</li>
</ul>
</details>
</li>
</ul>
<li class="directory">
<details>
<summary><strong>components/</strong></summary>
<ul>
<li class="directory">
<details>
<summary><strong>a-lot-of-files/</strong></summary>
<ul>
<li data-file-type class="file">...</li>
</ul>
</details>
</li>
</ul>
</details>
</li>
</details>
</li>
</ul>
</div>
[jade]
ul
li jadeが
li そのまま書けます
p またの名をpugとも言う
[/jade]
↓
<ul>
<li>jadeが</li>
<li>そのまま書けます</li>
</ul>
<p>またの名をpugとも言う</p>
これらの記法は、互いにネストすることはできません。
次に、mdパターン。
```html#素敵なdiv <div></div> ```
GFMのコードブロックで、Syntaxに続けて#コードのタイトル
を指定すると、以下が出力されます。
<section class="CG2-livecode">
<header class="CG2-livecode__header">
<div class="CG2-livecode__label">素敵なdiv</div>
</header>
<div class="CG2-livecode__body">
<pre><code class="lang-html">
<div></div>
</code></pre>
</div>
</section>
コードのタイトル指定がない場合、通常のMarkdownのコードブロックとして処理されます。
MIT
FAQs
CodeGrid-specified markdown processor.
The npm package codegrid-markdown receives a total of 41 weekly downloads. As such, codegrid-markdown popularity was classified as not popular.
We found that codegrid-markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.