Skip to content

Commit f41b56f

Browse files
committed
version 0.1.0
0 parents  commit f41b56f

19 files changed

+9613
-0
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/.cache/
2+
**/dist/
3+
**/node_modules/

.eslintrc.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"google",
8+
"eslint:recommended"
9+
],
10+
"parserOptions": {
11+
"ecmaVersion": 12,
12+
"sourceType": "module"
13+
},
14+
"rules": {},
15+
"globals": {
16+
"Docsify": "readonly",
17+
"$docsify": "readonly",
18+
"pseudocode": "readonly"
19+
}
20+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/.cache/
2+
**/node_modules/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Hunter Hwang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

dist/docsify-pseudocode.js

+171
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docsify-pseudocode.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docsify-pseudocode.min.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.nojekyll

Whitespace-only changes.

docs/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Docsify Pseudocode
2+
3+
## What it is
4+
5+
**docsify-pseudocode** is a plugin based on [pseudocode.js](https://github.com/SaswatPadhi/pseudocode.js) to render pseudocode in docsify. Using it, you can easily write pseudocode like Latex's algorithm packages in the markdown document.
6+
7+
## Features
8+
9+
All features come from pseudocode.js.
10+
11+
- **Intuitive grammar:** docsify-pseudocode takes a LaTeX-style input that supports the algorithmic constructs from LaTeX's algorithm packages. With or without LaTeX experience, a user should find the grammar fairly intuitive.
12+
- **Print quality:** The HTML output produced by docsify-pseudocode is (almost) identical with the pretty algorithms printed on publications that are typeset by LaTeX.
13+
- **Math formula support:** Inserting math formulas in docsify-pseudocode is as easy as LaTeX. Just enclose math expression in `$...$` or `\(...\)`.
14+
- **Multiple backends:** docsify-pseudocode supports [KaTex](https://github.com/KaTeX/KaTeX) and [MathJax](https://github.com/mathjax/MathJax) to render math formulas.
15+
16+
## Support
17+
18+
- Create a [GitHub issue](https://github.com/h-hg/docsify-pseudocode/issues) for bug reports, feature requests, or questions
19+
- Add a ⭐️ [star on GitHub](https://github.com/h-hg/docsify-pseudocode) to support the plugin!
20+
21+
## License
22+
23+
This project is licensed under the terms of the [MIT](https://github.com/h-hg/docsify-pseudocode/blob/master/LICENSE) license.

docs/_sidebar.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [Installation](installation.md)
2+
- [Usage](usage.md)
3+
- [Change Logs](changelogs.md)

docs/changelogs.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change logs
2+
3+
## v0.1.0 (2020-01-01)
4+
5+
- Render pseudocode by [pseudocode.js](https://github.com/SaswatPadhi/pseudocode.js)

docs/code/quicksort.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
% This quicksort algorithm is extracted from Chapter 7, Introduction to Algorithms (3rd edition)
2+
\begin{algorithm}
3+
\caption{Quicksort}
4+
\begin{algorithmic}
5+
\PROCEDURE{Quicksort}{$A, p, r$}
6+
\IF{$p < r$}
7+
\STATE $q = $ \CALL{Partition}{$A, p, r$}
8+
\STATE \CALL{Quicksort}{$A, p, q - 1$}
9+
\STATE \CALL{Quicksort}{$A, q + 1, r$}
10+
\ENDIF
11+
\ENDPROCEDURE
12+
\PROCEDURE{Partition}{$A, p, r$}
13+
\STATE $x = A[r]$
14+
\STATE $i = p - 1$
15+
\FOR{$j = p$ \TO $r - 1$}
16+
\IF{$A[j] < x$}
17+
\STATE $i = i + 1$
18+
\STATE exchange
19+
$A[i]$ with $A[j]$
20+
\ENDIF
21+
\STATE exchange $A[i]$ with $A[r]$
22+
\ENDFOR
23+
\ENDPROCEDURE
24+
\end{algorithmic}
25+
\end{algorithm}

docs/index.html

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Docsify Pseudocode</title>
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8+
<meta name="description" content="Description">
9+
<meta name="viewport"
10+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
11+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css" />
12+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.css">
13+
</head>
14+
15+
<body>
16+
<div id="app"></div>
17+
<script>
18+
window.$docsify = {
19+
name: 'Docsify Pseudocode',
20+
repo: 'https://github.com/h-hg/docsify-pseudocode',
21+
loadSidebar: true,
22+
copyCode: {
23+
buttonText: {
24+
'/': 'Copy to clipboard',
25+
'/zh-cn/': '点击复制'
26+
},
27+
errorText: {
28+
'/': 'Error',
29+
'/zh-cn/': '错误'
30+
},
31+
successText: {
32+
'/': 'Copied',
33+
'/zh-cn/': '复制'
34+
}
35+
},
36+
search: {
37+
paths: 'auto',
38+
noData: {
39+
'/': 'No results!',
40+
'/zh-cn/': '没有结果!'
41+
},
42+
placeholder: {
43+
'/': 'Search',
44+
'/zh-cn/': '搜索'
45+
}
46+
},
47+
tabs: {
48+
persist: true,
49+
sync: true,
50+
theme: 'classic',
51+
tabComments: true,
52+
tabHeadings: false
53+
},
54+
pseudocode: {
55+
indentSize: '1.2em',
56+
commentDelimiter: '//',
57+
lineNumber: false,
58+
lineNumberPunc: ':',
59+
noEnd: false,
60+
titlePrefix: 'Algorithm'
61+
},
62+
}
63+
</script>
64+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
65+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-javascript.min.js"></script>
66+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-markup.min.js"></script>
67+
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
68+
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
69+
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs"></script>
70+
<script src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
71+
<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
72+
<script src="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.js"></script>
73+
<script src="https://cdn.jsdelivr.net/gh/h-hg/docsify-pseudocode/dist/docsify-pseudocode.min.js"></script>
74+
</body>
75+
76+
</html>

0 commit comments

Comments
 (0)