Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
chore: docinpy doc
Browse files Browse the repository at this point in the history
  • Loading branch information
doomspec committed Oct 10, 2023
1 parent f72d1c1 commit f7ba53d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- evonote/**
- docinpy/**
- .github/workflows/analyze.yml

env:
OPENAI_API_KEY: NAN
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
# trigger deployment on every push to docs folder
paths:
- docs/**
- .github/workflows/deploy.yml

jobs:
docs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gen_project_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from evonote.transform.module_to_tree import get_tree_for_module
tree = get_tree_for_module(evonote)
tree_in_dict = get_json_for_treemap(tree.root)
f = open('output/project_tree.json', 'w');json.dump(tree, f)
f = open('output/project_tree.json', 'w');json.dump(tree_in_dict, f)
10 changes: 6 additions & 4 deletions docs/docinpy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ a_folder
```
You can put `a`,`b` in a section by putting
```yaml
sections
sections:
your section title:
- a
- b
default section: you default section title
```



Then `a` and `b` will be in the section `your section title` and `c` will be in the section `you default section title`.

### Mark examples

Expand Down
5 changes: 2 additions & 3 deletions evonote/file_helper/cache_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def __init__(self, cache_path: str = None):

def save_all_cache_to_file(self):
self.apply_cache_update()
if len(self.cache_table) == 0:
return
with open(self.cache_path, "w") as f:
f.write(serialize_cache_table(self.cache_table))

Expand Down Expand Up @@ -125,9 +127,6 @@ def discard_cache_update(self):

def load_cache_table(self) -> CacheTable:
if not os.path.exists(self.cache_path):
# Create file if not exists
with open(self.cache_path, "w") as f:
f.write("[]")
return {}
with open(self.cache_path, "r") as f:
cache_list = json.load(f)
Expand Down

0 comments on commit f7ba53d

Please sign in to comment.