-
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.
feat: add initial documentation (#7)
- Loading branch information
Showing
11 changed files
with
362 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Deploy Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Build Docs site | ||
run: python3 build_docs.py | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.ZYNK_DOCS }} | ||
publish_dir: ./site |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
CMakePresets.json | ||
out/ | ||
out/ | ||
venv/ |
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,32 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
def install_dependencies(): | ||
"""Install MkDocs and the necessary plugins.""" | ||
try: | ||
# Check if MkDocs is installed | ||
subprocess.run([sys.executable, "-m", "pip", "install", "mkdocs"], check=True) | ||
subprocess.run([sys.executable, "-m", "pip", "install", "mkdocs-material"], check=True) | ||
print("Successfully installed MkDocs and MkDocs Material.") | ||
except subprocess.CalledProcessError as e: | ||
print("Error installing dependencies:", e) | ||
sys.exit(1) | ||
|
||
def build_docs(): | ||
"""Build the documentation using MkDocs.""" | ||
try: | ||
subprocess.run(["mkdocs", "build"], check=True) | ||
print("Documentation built successfully.") | ||
except subprocess.CalledProcessError as e: | ||
print("Error building documentation:", e) | ||
sys.exit(1) | ||
|
||
def main(): | ||
print("Starting the documentation build process...") | ||
install_dependencies() | ||
build_docs() | ||
print("Documentation build process completed.") | ||
|
||
if __name__ == "__main__": | ||
main() |
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,45 @@ | ||
# Contributing | ||
|
||
Contributions to Zynk are highly welcome and greatly appreciated! Whether you are a seasoned developer or a newcomer, your input can help improve the project and make it better for everyone. | ||
|
||
### How to Contribute | ||
|
||
Here are a few simple steps to get involved: | ||
|
||
1. **Fork the Repository:** | ||
Create a fork of the Zynk repository to make your changes. This allows you to work on your copy of the project and propose improvements or fixes. | ||
|
||
2. **Develop Your Changes:** | ||
Work on your feature or bug fix in your forked repository. Make sure to write clear, concise code and provide helpful comments where necessary. | ||
|
||
3. **Create a Pull Request:** | ||
Once you're satisfied with your changes, create a pull request (PR) to the main Zynk repository. Provide a detailed description of your changes and the motivation behind them. | ||
|
||
4. **Collaborate and Iterate:** | ||
Engage with the community by responding to feedback on your pull request. We encourage open discussion and value every contribution, big or small. | ||
|
||
### Contribution Ideas | ||
|
||
Here are a few ways you can contribute to Zynk: | ||
|
||
- **Bug Reports:** | ||
If you encounter any issues or bugs while using Zynk, please report them through our [Issue Tracker](https://github.com/xXenvy/Zynk/issues). Detailed bug reports help us identify and fix problems quickly. | ||
|
||
- **Feature Requests:** | ||
If you have ideas for new features or improvements, share them with the community through our [Feature Request](https://github.com/xXenvy/Zynk/issues) section. We are always open to innovative suggestions. | ||
|
||
- **Documentation Enhancements:** | ||
Clear and concise documentation is crucial for any project. You can help improve the Zynk documentation by fixing typos, adding examples, or clarifying explanations. | ||
|
||
- **Code Improvements:** | ||
Review the existing codebase and suggest optimizations or refactorings. Clean, efficient code is vital for the long-term success of the project. | ||
|
||
- **Test Cases:** | ||
Writing test cases is essential for ensuring code stability and functionality. You can contribute by adding new tests or improving existing ones. | ||
|
||
### Getting Help | ||
|
||
If you need assistance or have questions about contributing, feel free to reach out to the Zynk community: | ||
|
||
- **Discussion Forum:** | ||
Join [Discussion Forum](https://github.com/xXenvy/Zynk/discussions) to ask questions, and share ideas. |
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 @@ | ||
# Data types | ||
|
||
Zynk currently supports only primitive data types, which are fundamental for basic computations and operations. Understanding these types is essential for writing efficient and correct programs. This section will cover the basic data types available in Zynk. | ||
|
||
## Primitive Data Types | ||
|
||
Zynk offers several primitive data types: | ||
|
||
- **Integer (`int`)**: Represents whole numbers without decimals. | ||
- **Float (`float`)**: Represents numbers with decimals. | ||
- **Bool (`bool`)**: Represents truth values, true or false (1 and 0). | ||
- **String (`String`)**: Represents sequences of 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,49 @@ | ||
# Basic Examples | ||
|
||
Welcome to the Basic Examples section. Here, we showcase fundamental code snippets to help you get started with Zynk. | ||
|
||
## Example 1: Basic Variables and Output | ||
|
||
This example demonstrates the use of variables and basic output functions. | ||
|
||
def main() { | ||
var x: int = 1; | ||
var y: String = "elo"; | ||
println(x); | ||
println(y); | ||
} | ||
main(); | ||
|
||
## Example 2: Control Flow with Loops and Conditionals | ||
|
||
This example shows how to use loops and conditionals in Zynk. | ||
|
||
def main() { | ||
var x: int = 1; | ||
|
||
while(true) { | ||
if(x == 1) { | ||
break; | ||
} | ||
} | ||
} | ||
main(); | ||
|
||
## Example 3: Nested Functions | ||
|
||
This example demonstrates defining and calling functions, including nested functions. | ||
|
||
def main() { | ||
var number: int = 1; | ||
|
||
def displayNumber() { | ||
println(number); | ||
var multiplier: float = 1.5; | ||
def calculateAndPrint() { | ||
println(number * multiplier); | ||
} | ||
calculateAndPrint(); | ||
} | ||
displayNumber(); | ||
} | ||
main(); |
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,60 @@ | ||
# Write your first program | ||
|
||
Welcome to the "Hello, World!" tutorial for Zynk. In this guide, we'll create a simple Zynk program that prints "Hello, World!" to the console. Follow the steps below to get started. | ||
|
||
## 1. Create a new Zynk file | ||
|
||
First, you'll need to create a new file with a `.zk` extension. This file will contain your Zynk code. | ||
|
||
1. Open your favorite text editor or IDE. | ||
2. Create a new file and save it as `hello.zk`. | ||
|
||
## 2. Write your Zynk program | ||
|
||
In the `hello.zk` file, write the following Zynk code: | ||
|
||
println("Hello, World!"); | ||
|
||
### Explanation | ||
|
||
- `println("Hello, World!");`: This line of code calls the `println` function, which outputs the string `"Hello, World!"` to the console followed by a newline character. | ||
|
||
## 3. Run your Zynk program | ||
|
||
To run your Zynk program, follow these steps: | ||
|
||
1. **Open a Terminal or Command Prompt.** | ||
2. **Navigate to the directory containing your `hello.zk` file. For example:** | ||
|
||
``` | ||
cd path/to/your/directory | ||
``` | ||
|
||
3. **Execute the Zynk interpreter with your file as an argument:** | ||
|
||
``` | ||
./Zynk hello.zk | ||
``` | ||
|
||
### Expected Output | ||
|
||
When you run the program, you should see the following output: | ||
|
||
Hello, World! | ||
|
||
## 4. Troubleshooting | ||
|
||
If you encounter any issues, make sure of the following: | ||
|
||
- The Zynk interpreter is correctly installed and located in your system's PATH. | ||
- The file extension is `.zk` and the code is properly written. | ||
- You are running the command from the directory where `hello.zk` is located. | ||
|
||
## Next Steps | ||
|
||
Congratulations on writing your first Zynk program! Here are some suggestions for what to do next: | ||
|
||
- Explore more Zynk functions and syntax by referring to the [Language Reference](#) section of the documentation. | ||
- Experiment with more complex programs and learn about variables, loops, and functions in Zynk. | ||
|
||
Happy coding! |
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,37 @@ | ||
# Welcome | ||
|
||
This is the official documentation for Zynk, a language designed primarily for educational purposes and exploration. Zynk is not intended for production use but serves as an interesting platform for learning and experimenting with C++. | ||
|
||
## 🌟 Features | ||
|
||
- **Interpreted Language:** Zynk is an interpreted language, designed to speed up development and testing cycles. With its interactive environment, you can quickly prototype and debug your code without the need for lengthy compile times. | ||
|
||
- **Turing-Complete:** Zynk adheres to the Turing-complete classification, meaning it can express any computable function. This makes Zynk a versatile tool for solving a wide range of problems, from simple scripts to complex algorithms. | ||
|
||
- **C++ Backend:** Written in C++, Zynk combines the high performance and efficiency of C++ with a user-friendly interface. This hybrid approach ensures that your applications run swiftly while remaining easy to develop and maintain. | ||
|
||
## 🚀 Getting Started | ||
|
||
To get started with Zynk, follow these steps: | ||
|
||
1. **Installation**: Download and install the latest version of Zynk from [Installation Guide](installation.md). | ||
2. **Hello World**: Write your first Zynk program with [Hello World Tutorial](examples/hello_world.md). | ||
|
||
## 🔍 Language Reference | ||
|
||
Dive into the specifics of Zynk’s syntax and semantics: | ||
|
||
- **Basic Syntax**: Learn the fundamental rules and conventions of Zynk syntax in [Basic Examples](examples/basics.md). | ||
- **Data Types**: Explore the different data types available in Zynk and how to use them effectively in [Data Types](data-types.md). | ||
|
||
## 🤝 Contributing | ||
|
||
Contributions to Zynk are welcome. Learn how to contribute on [Contribution Guidelines](contributing.md). | ||
|
||
## 🛠️ Support | ||
|
||
For support and troubleshooting, please refer to the following resources: | ||
|
||
- **Issues:** Report bugs, request features, or track existing issues on [GitHub Issues Page](https://github.com/xXenvy/Zynk/issues). | ||
- **Discussions:** Engage with the community, ask questions, and share ideas on [GitHub Discussions Page](https://github.com/xXenvy/Zynk/discussions). | ||
|
Oops, something went wrong.