For how to clone and build this project, checkout the third method mentioned in Installation Guide.
First of all, run:
npm installThis will help you get all deps used by this project. Then you can call:
npm run devThis will start webpack in watch mode with development flag enabled.
A custom conole wrapper mditLogger is recommend when you need to log something in Renderer Process. You can import the logger by:
import { mditLogger } from './utils/logger';
function someFunc() {
mditLogger('debug', 'debug info here.'); // Output: [MarkdownIt] debug info here.
}Use mditLogger whenever possible.
To create a release version of this extension, please run:
npm run release # create Release.zip with ./dist includedThe script npm run release will:
- Run
npm run buildto generate./distresources. - Run
git archiveto create arelease.zipfile contains all code included ingit. - Run
zip -rto adddistdirectory into previously generatedrelease.zip.
You could use React to develop plugin settings UI interface. The entrance of user settings page is src/components/setting_page.js
// react_component_file.js
import React from 'react';
export function YourComponentHere(){
return (<p>Test</p>);
}Currently support file extension for webpack contains:
.js.jsx.ts.tsx
You could use Markdown below as a quick Markdown Rendering Test.
# Display Test
## Normal
Normal test
Normal test with HTML Entities & " ' < > .
## List
- List Item
- List Item
1. Ordered List
2. Ordered List
## Blockquote
> Test
>
>> Nested Test
## Code
Inline Code test `int main(){ return 0; }`
Inline Code test with HTML Entities: `<p>Hello!</p>`
```
// Cpp Code Test
#include <iostream>
int a = 0;
int& b = a;
```
```
Plain text with HTML Entities <p>Hello</p>
```
## LaTeX
$$
\displaystyle \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
$$
Example Output Screenshot:
