forked from PKUanonym/REKCARC-TSC-UHT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44998fa
commit 92c8f8d
Showing
2,013 changed files
with
362 additions
and
145,515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os, subprocess | ||
from setuptools import setup | ||
|
||
subprocess.check_call('python3 ./source/gen.py --root . --output source'.split()) | ||
|
||
setup( | ||
name='thu-cst-cracker', | ||
description='frontend generator', | ||
install_requires=['sphinx-markdown-tables'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = 'THU-CST-Cracker' | ||
copyright = '2020, PKUanonym' | ||
author = 'PKUanonym' | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
'''import recommonmark | ||
from recommonmark.transform import AutoStructify | ||
# At the bottom of conf.py | ||
def setup(app): | ||
app.add_config_value('recommonmark_config', { | ||
'url_resolver': lambda url: github_doc_root + url, | ||
'auto_toc_tree_section': 'Contents', | ||
}, True) | ||
app.add_transform(AutoStructify) | ||
'''# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ['recommonmark', 'sphinx_markdown_tables'] | ||
source_suffix = ['.rst', '.md'] | ||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = 'zh' | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
import sphinx_rtd_theme | ||
html_theme = "sphinx_rtd_theme" | ||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
master_doc = 'index' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os, argparse | ||
from os.path import sep | ||
|
||
EXCLUDE = ['.git', '.gitignore', 'LICENSE', 'Makefile', 'make.bat', 'setup.py', 'source', 'thu_cst_cracker.egg-info'] | ||
README_MD = ['README.md', 'readme.md'] | ||
EXT = '.md' | ||
PREFIX = 'https://github.com/PKUanonym/REKCARC-TSC-UHT/blob/master/' | ||
rst = '''Welcome to THU-CST-Cracker! | ||
=========================================== | ||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
TOC | ||
Indices and tables | ||
================== | ||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` | ||
''' | ||
|
||
def name_filter(s): | ||
return s.replace('_', '\\_') | ||
|
||
def url_filter(s, p): | ||
c = 'tree' if os.path.isdir(s) else 'blob' | ||
return PREFIX.replace('blob', c) + s.replace(p, sep.join(p.split(sep)[-2:])).replace('(', '%28').replace(')', '%29').replace(' ', '%20').replace(EXT, '%2e%6d%64') | ||
|
||
def get_all(d): | ||
_all = [os.path.join(d, i) for i in os.listdir(d)] | ||
files = [i for i in _all if os.path.isfile(i)] | ||
dirs = [i for i in _all if os.path.isdir(i)] | ||
files.sort() | ||
dirs.sort() | ||
return files, dirs | ||
|
||
def get_course(root, cur, depth=0, threshold=30): | ||
files, dirs = get_all(cur) | ||
file_num = 0 | ||
md_dir, md_file = '', '' | ||
for i in dirs: | ||
d_md, d_num = get_course(root, i, depth + 1) | ||
if depth >= 2 and d_num > threshold: | ||
files.append(i) | ||
print(depth, d_num, i) | ||
else: | ||
md_dir += f'{" " * depth}- [{name_filter(i.split(sep)[-1])}]({url_filter(i, root)})\n' | ||
md_dir += d_md | ||
file_num += d_num | ||
files.sort() | ||
for i in files: | ||
file_num += 1 | ||
if i.split(sep)[-1] in README_MD and depth == 0: | ||
md_file = open(i).read().replace('#', '\t') + '\n\n' + md_file | ||
else: | ||
md_file += f'{" " * depth}- [{name_filter(i.split(sep)[-1])}]({url_filter(i, root)})\n' | ||
md = md_file + md_dir | ||
return md, file_num | ||
|
||
def get_semester(cur): | ||
md = '' | ||
files, dirs = get_all(cur) | ||
for i in files: | ||
if i.endswith(EXT): | ||
md += f'{open(i).read()}\n\n' | ||
for i in files: | ||
if not i.endswith(EXT): | ||
md += f'[{name_filter(i.split(sep)[-1])}]({url_filter(i, cur)})\n\n' | ||
for i in dirs: | ||
d_md, d_num = get_course(i, i) | ||
md += f'## [{name_filter(i.split(sep)[-1])}]({url_filter(i, cur)})\n\n{d_md}\n\n' | ||
return md | ||
|
||
def gen_md(d, n, m): | ||
if 'README' not in n: | ||
m = f'# {n.replace(EXT, "").split(sep)[-1]}\n\n{m}' | ||
if not n.endswith(EXT): | ||
n += EXT | ||
print(d, n) | ||
open(os.path.join(d, n), 'w').write(m) | ||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--root", type=str, default='REKCARC-TSC-UHT') | ||
parser.add_argument("--output", type=str, default='.') | ||
args = parser.parse_args() | ||
files, dirs = get_all(args.root) | ||
files = [i for i in files if i.split(sep)[-1] not in EXCLUDE] | ||
dirs = [i for i in dirs if i.split(sep)[-1] not in EXCLUDE] | ||
print(files) | ||
print(dirs) | ||
if not os.path.exists(args.output): | ||
os.makedirs(args.output) | ||
for i in files: | ||
gen_md(args.output, i.replace(args.root, '.'), open(i).read()) | ||
for i in dirs: | ||
gen_md(args.output, i.replace(args.root, '.'), get_semester(i)) | ||
_all = [i.replace(EXT, '').split(sep)[-1] for i in files + dirs] | ||
rst = rst.replace('TOC', '\n '.join(_all)) | ||
rst = rst.replace('二', '无').replace('三', '二').replace('无', '三') | ||
open(os.path.join(args.output, 'index.rst'), 'w').write(rst) |
Binary file not shown.
Binary file removed
BIN
-156 Bytes
大一小学期/Week_3-Python/exam/2015/calc/add/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-201 Bytes
大一小学期/Week_3-Python/exam/2015/calc/add/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-198 Bytes
大一小学期/Week_3-Python/exam/2015/calc/add/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.21 KB
大一小学期/Week_3-Python/exam/2015/calc/add/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-167 Bytes
大一小学期/Week_3-Python/exam/2015/calc/add/migrations/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-157 Bytes
大一小学期/Week_3-Python/exam/2015/calc/calc/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.32 KB
大一小学期/Week_3-Python/exam/2015/calc/calc/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-1 KB
大一小学期/Week_3-Python/exam/2015/calc/calc/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-573 Bytes
大一小学期/Week_3-Python/exam/2015/calc/calc/__pycache__/wsgi.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-180 Bytes
...k_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.39 KB
...k_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-1008 Bytes
.../Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-600 Bytes
.../Week_3-Python/exam/2016/2015011334_week3/3/mysite/mysite/__pycache__/wsgi.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-186 Bytes
...thon/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-310 Bytes
...-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-485 Bytes
...3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/apps.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-743 Bytes
...Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-373 Bytes
...3-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-1.12 KB
...-Python/exam/2016/2015011334_week3/3/mysite/searchengine/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-825 Bytes
...2015011334_week3/3/mysite/searchengine/migrations/__pycache__/0001_initial.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-736 Bytes
...week3/3/mysite/searchengine/migrations/__pycache__/0002_auto_20160909_1144.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-197 Bytes
...016/2015011334_week3/3/mysite/searchengine/migrations/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-164 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-158 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-209 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-199 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/admin.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-206 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-196 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/models.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-2.37 KB
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.09 KB
大一小学期/Week_3-Python/exam/2017/3/calc/add/__pycache__/views.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-175 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-169 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/add/migrations/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-165 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-159 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-2.33 KB
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.22 KB
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/settings.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-1.01 KB
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-1001 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/urls.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-581 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-557 Bytes
大一小学期/Week_3-Python/exam/2017/3/calc/calc/__pycache__/wsgi.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-120 Bytes
大一小学期/Week_3-Python/exam/2019/3/exam3/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-2.21 KB
大一小学期/Week_3-Python/exam/2019/3/exam3/__pycache__/settings.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-355 Bytes
大一小学期/Week_3-Python/exam/2019/3/exam3/__pycache__/urls.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-1.77 KB
大一小学期/Week_3-Python/exam/2019/3/exam3/__pycache__/view.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-519 Bytes
大一小学期/Week_3-Python/exam/2019/3/exam3/__pycache__/wsgi.cpython-36.pyc
Binary file not shown.
Binary file removed
BIN
-159 Bytes
大一小学期/Week_3-Python/hw/2016/lzl/form/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-204 Bytes
大一小学期/Week_3-Python/hw/2016/lzl/form/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-256 Bytes
大一小学期/Week_3-Python/hw/2016/lzl/form/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-372 Bytes
大一小学期/Week_3-Python/hw/2016/lzl/form/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.16 KB
大一小学期/Week_3-Python/hw/2016/lzl/form/__pycache__/views.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-161 Bytes
大一小学期/Week_3-Python/hw/2016/lzl/mysite/__pycache__/__init__.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-2.33 KB
大一小学期/Week_3-Python/hw/2016/lzl/mysite/__pycache__/settings.cpython-35.pyc
Binary file not shown.
Binary file removed
BIN
-1 KB
大一小学期/Week_3-Python/hw/2016/lzl/mysite/__pycache__/urls.cpython-35.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-380 KB
大三上/编译原理/hw/2015_刘智峰_PA/Lex&yacc/Compiler Construction Using Flex and Bison.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.