Skip to content

Commit

Permalink
version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
h-hg committed Jan 1, 2021
0 parents commit f41b56f
Show file tree
Hide file tree
Showing 19 changed files with 9,613 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.cache/
**/dist/
**/node_modules/
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"google",
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {},
"globals": {
"Docsify": "readonly",
"$docsify": "readonly",
"pseudocode": "readonly"
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.cache/
**/node_modules/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Hunter Hwang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
171 changes: 171 additions & 0 deletions dist/docsify-pseudocode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/docsify-pseudocode.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions dist/docsify-pseudocode.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added docs/.nojekyll
Empty file.
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Docsify Pseudocode

## What it is

**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.

## Features

All features come from pseudocode.js.

- **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.
- **Print quality:** The HTML output produced by docsify-pseudocode is (almost) identical with the pretty algorithms printed on publications that are typeset by LaTeX.
- **Math formula support:** Inserting math formulas in docsify-pseudocode is as easy as LaTeX. Just enclose math expression in `$...$` or `\(...\)`.
- **Multiple backends:** docsify-pseudocode supports [KaTex](https://github.com/KaTeX/KaTeX) and [MathJax](https://github.com/mathjax/MathJax) to render math formulas.

## Support

- Create a [GitHub issue](https://github.com/h-hg/docsify-pseudocode/issues) for bug reports, feature requests, or questions
- Add a ⭐️ [star on GitHub](https://github.com/h-hg/docsify-pseudocode) to support the plugin!

## License

This project is licensed under the terms of the [MIT](https://github.com/h-hg/docsify-pseudocode/blob/master/LICENSE) license.
3 changes: 3 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Installation](installation.md)
- [Usage](usage.md)
- [Change Logs](changelogs.md)
5 changes: 5 additions & 0 deletions docs/changelogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change logs

## v0.1.0 (2020-01-01)

- Render pseudocode by [pseudocode.js](https://github.com/SaswatPadhi/pseudocode.js)
25 changes: 25 additions & 0 deletions docs/code/quicksort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
% This quicksort algorithm is extracted from Chapter 7, Introduction to Algorithms (3rd edition)
\begin{algorithm}
\caption{Quicksort}
\begin{algorithmic}
\PROCEDURE{Quicksort}{$A, p, r$}
\IF{$p < r$}
\STATE $q = $ \CALL{Partition}{$A, p, r$}
\STATE \CALL{Quicksort}{$A, p, q - 1$}
\STATE \CALL{Quicksort}{$A, q + 1, r$}
\ENDIF
\ENDPROCEDURE
\PROCEDURE{Partition}{$A, p, r$}
\STATE $x = A[r]$
\STATE $i = p - 1$
\FOR{$j = p$ \TO $r - 1$}
\IF{$A[j] < x$}
\STATE $i = i + 1$
\STATE exchange
$A[i]$ with $A[j]$
\ENDIF
\STATE exchange $A[i]$ with $A[r]$
\ENDFOR
\ENDPROCEDURE
\end{algorithmic}
\end{algorithm}
76 changes: 76 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Docsify Pseudocode</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.css">
</head>

<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'Docsify Pseudocode',
repo: 'https://github.com/h-hg/docsify-pseudocode',
loadSidebar: true,
copyCode: {
buttonText: {
'/': 'Copy to clipboard',
'/zh-cn/': '点击复制'
},
errorText: {
'/': 'Error',
'/zh-cn/': '错误'
},
successText: {
'/': 'Copied',
'/zh-cn/': '复制'
}
},
search: {
paths: 'auto',
noData: {
'/': 'No results!',
'/zh-cn/': '没有结果!'
},
placeholder: {
'/': 'Search',
'/zh-cn/': '搜索'
}
},
tabs: {
persist: true,
sync: true,
theme: 'classic',
tabComments: true,
tabHeadings: false
},
pseudocode: {
indentSize: '1.2em',
commentDelimiter: '//',
lineNumber: false,
lineNumberPunc: ':',
noEnd: false,
titlePrefix: 'Algorithm'
},
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/components/prism-javascript.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/components/prism-markup.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/h-hg/docsify-pseudocode/dist/docsify-pseudocode.min.js"></script>
</body>

</html>
Loading

0 comments on commit f41b56f

Please sign in to comment.