提交 1d664a0a 编写于 作者: M Mars Liu

document and test

上级 437e5edf
......@@ -5,3 +5,8 @@
## 说明
CSDN 技能树结构(章节、元信息、习题)解释器,支持技能树结构和内容的分析、解释。
## what's new
### 0.0.4
- 支持在习题中内嵌 markdown 源码
\ No newline at end of file
......@@ -7,7 +7,7 @@ this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
setup(name="skill-tree-parser",
version="0.0.3",
version="0.0.4",
description="CSDN Skill Tree Parser",
long_description=long_description,
long_description_content_type='text/markdown',
......
......@@ -187,7 +187,6 @@ public class App {
class MathTestCase(unittest.TestCase):
def test_parse(self):
data = "$e^{pi}$"
result = processor(data)
......@@ -252,3 +251,57 @@ Spark擅长处理DataFrame,Neo4j擅长处理图数据,使用连接器可以
Spark连接器在开源社区版上无法使用
"""
learn = """
# 代码块
请点击[代码块](https://codechina.csdn.net/courses/register/2/8){target="_blank"} 并完成所有题目,完成学习请关闭Issue。
通过对[代码块](https://codechina.csdn.net/courses/register/2/8){target="_blank"}的学习,以下哪个代码块语法不对?
## 答案
```bash
行内代码块 ```hello```
```
## 选项
### A
```bash
行内代码块 `hello`
```
### B
````bash
```diff
var foo = 'bar';
+ var x = 200;
* var x = 100;
```
````
### C
````bash
```python
def fibo(max):
n, a, b = 0, 0, 1
while n < max:
yield b
a, b = b, a + b
n = n + 1
for n in fibo(10):
print (n)
```
````
"""
class MarkdownBlockTestCase(unittest.TestCase):
def test_parse(self):
state = BasicState(learn.strip())
doc = mk.parse(state)
self.assertEqual("```diff\nvar foo = 'bar';\n+ var x = 200;\n* var x = 100;\n```",
doc.options[1].paras[0].source)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册