Skip to content

Commit

Permalink
Merge pull request #4 from HydroRoll-Team/mkdocs
Browse files Browse the repository at this point in the history
add docs
  • Loading branch information
HsiangNianian authored Jul 25, 2023
2 parents ccbe69c + 7ef3b60 commit 5f85e4f
Show file tree
Hide file tree
Showing 35 changed files with 271 additions and 3,432 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ src/main.aux
src/main.fdb_latexmk
src/main.fls
src/main.log
src/main.synctex.gz
src/main.synctex.gz

# LangTrans
LangTrans-main/

# mkdocs
docs/site/
Empty file added docs/docs/blog/index.md
Empty file.
Empty file added docs/docs/changelog/index.md
Empty file.
48 changes: 48 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Psi CLI 语言
========================

Psi is a new programming language designed with simplicity, flexibility, and performance in mind. It provides a clean and intuitive syntax that is easy to read and write, making it an excellent choice for both beginners and experienced programmers.


Features
--------

- `Lexer Module`_: The lexer module is responsible for converting the source code into a sequence of tokens. It recognizes the basic elements of the language such as identifiers, keywords, operators, and literals. ``['OPERATOR', 'IDENTIFIER', 'SEPARATOR', 'SEPARATOR', 'CONTROL', 'IDENTIFIER', 'OPERATOR', 'INTEGER', 'SEPARATOR', 'IDENTIFIER', 'SEPARATOR', 'IDENTIFIER', 'OPERATOR', 'IDENTIFIER', 'SEPARATOR', 'IDENTIFIER', 'SEPARATOR', 'EOF']``

- `Parser Module`_: The parser module takes the sequence of tokens generated by the lexer module and transforms it into an Abstract Syntax Tree (AST). The AST is a tree-like data structure that represents the source code in a way that is closer to the syntactic structure of the programming language.

- `Built-in Types Module`_: This module defines the built-in types of the Psi language, such as lists and dictionaries. It provides functions for creating and manipulating instances of these types.

- `Error Handling Module`_: This module provides a mechanism for catching and handling errors during runtime. It defines a set of exception classes and functions for throwing and catching these exceptions.

- `Execution Environment Module`_: This module defines the execution environment of the Psi language, including the scope and lifecycle of variables. It provides functions for defining and looking up variables in the execution environment.

- `Interpreter Module`_: The main task of this module is to traverse the AST and perform the corresponding operations in the execution environment.

- `Mathematics Foundation Module`_: This module provides basic mathematical functions and constants, such as addition, subtraction, multiplication, and division.

- `Documentation Module`_: This module uses reStructuredText and Sphinx to build the documentation, providing API interface descriptions and usage examples.


Getting Started
---------------

To get started with Psi, you can clone the repository and follow the instructions in the README file. The repository includes a comprehensive set of examples that demonstrate the various features of the language.


Contributing
------------

Contributions to the Psi project are welcome. If you have a feature request, bug report, or proposal for improvement, please open an issue on the project's GitHub page. If you wish to contribute code, please fork the repository and submit a pull request.

How to build docs

git clone https://github.com/HydroRoll-Team/psi.git
cd psi/psi/docs
sphinx-build -b html . _build/html


License
-------

Psi is open-source software, licensed under the MIT license. This means you are free to use, modify, and distribute it under the terms of this license.
117 changes: 117 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
site_name: Psi Docs (Draft)
repo_url: https://github.com/HydroRoll-Team/psi
repo_name: HydroRoll-Team/psi
edit_uri: edit/main/docs/


theme:
name: material
language: en
icon:
logo: material/library-outline
repo: fontawesome/brands/git-alt
custom_dir: overrides
features:
- content.action.edit
- content.action.view
- navigation.footer
- navigation.tabs
# - navigation.tabs.sticky
- navigation.sections
- navigation.expand
- navigation.path
- navigation.indexes
- toc.follow
- navigation.top
- search.highlight
- search.suggest
- search.share
- header.autohide
- navigation.footer
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to system preference

extra:
version:
provider: mike
default: stable
homepage: https://psi.retrofor.space
alternate:
# - name: English
# link: /en/
# lang: en
- name: 中文
link: /
lang: zh
consent:
title: Cookie consent
description: >-
We use cookies to recognize your repeated visits and preferences, as well
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better.
actions:
- accept
- manage
cookies:
analytics:
name: Google Analytics
checked: true
github:
name: GitHub
checked: true
analytics:
feedback:
title: Was this page helpful?
ratings:
- icon: material/emoticon-happy-outline
name: This page was helpful
data: 1
note: >-
Thanks for your feedback!
- icon: material/emoticon-sad-outline
name: This page could be improved
data: 0
note: >-
Thanks for your feedback! Help us improve this page by
using our <a href="..." target="_blank" rel="noopener">feedback form</a>.
social:
- icon: fontawesome/brands/github
link: https://github.com/HydroRoll-Team

extra_css:
- stylesheets/extra.css

extra_javascript:
- javascripts/extra.js

copyright: >
Copyright &copy; 2013 - PRESENT. <a href="https://github.com/HydroRoll-Team">HydroRoll-Team</a> –
<a href="#__consent">Change cookie settings</a>
plugins:
- blog
- search
- git-authors
# - git-revision-date-localized
# - git-committers:
# repository: HydroRoll-Team/psi
# branch: main
4 changes: 0 additions & 4 deletions psi/docs/_build/html/.buildinfo

This file was deleted.

Binary file removed psi/docs/_build/html/.doctrees/api/psi.doctree
Binary file not shown.
Binary file removed psi/docs/_build/html/.doctrees/environment.pickle
Binary file not shown.
Binary file removed psi/docs/_build/html/.doctrees/index.doctree
Binary file not shown.
7 changes: 0 additions & 7 deletions psi/docs/_build/html/_sources/api/psi.rst.txt

This file was deleted.

5 changes: 0 additions & 5 deletions psi/docs/_build/html/_sources/index.rst.txt

This file was deleted.

Loading

0 comments on commit 5f85e4f

Please sign in to comment.