Skip to content

Commit

Permalink
Add contribution guidelines and about section
Browse files Browse the repository at this point in the history
  • Loading branch information
izxxr committed Jan 6, 2024
1 parent 8cd1f59 commit 5317171
Show file tree
Hide file tree
Showing 11 changed files with 256 additions and 6 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# The Python Guide
Comprehensive Python guide for absolute beginners
**Available to be viewed at thepyguide.github.io**

View at https://thepyguide.github.io
A comprehensive guide and tutorial for the Python programming language.

This guide is focused to be:

- **Comprehensive**: covering all important aspects of the language
- **Beginner friendly**: suitable for absolute beginners
- **Free to access**: entirely free of any cost
- **Chronological**: topics are sorted in chronological order
- **Navigable**: the interface and structure is easy to comprehend
- **Up-to-date**: always up-to-date with modern features and practices
- **Open source**: powered by and encourages community contributions

## Contributing
The Python Guide is powered by and encourages community contributions. For
users looking to contribute, please read the [Contributor Guide](./contributing.md).
Binary file added docs/_images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/logo_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="intro-title">The <span style="color: #ffd344">Python</span> Guide</h1
<h2 class="intro-subtitle">A comprehensive guide to Python programming.</h2>
<div class="btn-group">
<a href="/introduction"><button class="btn primary">Get Started</button></a>
<a href="#__features"><button class="btn secondary">Features</button></a>
<a href="/about"><button class="btn secondary">Learn More</button></a>
</div>
</div>
</div>
Expand Down
49 changes: 49 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
hide:
- navigation
---

# About
**The Python Guide** is a comprehensive guide and tutorial for the Python
programming language.

This guide is focused to be:

- **Comprehensive**: covering all important aspects of the language
- **Beginner friendly**: suitable for absolute beginners
- **Free to access**: entirely free of any cost
- **Chronological**: topics are sorted in chronological order
- **Navigable**: the interface and structure is easy to comprehend
- **Up-to-date**: always up-to-date with modern features and practices
- **Open source**: powered by and encourages community contributions

!!! note

**The Python Guide** is currently under active development. Coverage
of many other features of the language will be available soon.

## Outline
This guide covers the topics in a chronological order starting from
introductory concepts and ascending to more complex and advanced topics.

The outline of this guide is:

- Introduction
<!-- -->
1. Getting Started
2. Fundamental Concepts
3. Control Structures
4. String Operations
5. Functions
6. Exception Handling

More topics are being added and will be available soon.

## Inspiration
The structure of this guide takes a lot of inspiration from the
[The Rust Programming Language book](https://doc.rust-lang.org/book/). The
color scheme used in this website is inspired by Python's color scheme.

## Contributing
The Python Guide is powered by and encourages community contributions. For
users looking to contribute, please read the [Contributor Guide](./contributing/index.md).
89 changes: 89 additions & 0 deletions docs/contributing/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Working with project code
This section outlines the basic guidelines and conventions for the
source code of this guide.

## Directory structure
The `docs/` folder consists of the source code for the guide.

- `docs/_images/` stores the images that are used in the guide.
- `docs/_styles/` stores the CSS stylesheets used for website.
- `docs/_templates/` stores Jinja templates used for websites.
- Other directories and files in this folder correspond to the appropriate
sections in the guide.

## Theme
This guide uses [MkDocs Material theme](https://squidfunk.github.io/mkdocs-material/) theme.

Elements of the theme that are commonly used are listed below with
their corresponding documentation. For other elements, please see
the documentation of Material theme.

- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/)
- [Annotations](https://squidfunk.github.io/mkdocs-material/reference/annotations/)
- [Code Blocks](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/)
- [Content Tabs](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/)

## Code blocks
Code blocks in the guide are showcased using the [Content Tabs](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/) feature of
the theme.

Each code block has at least two tabs: one for code, other for output

Example:
```md
=== "Code"

```py
print('code here!')
```

=== "Output"

<!-- Expected output is added here as a markdown codeblock -->

```
code here!
```
```
Above code is displayed as:

=== "Code"

```py
print('code here!')
```

=== "Output"

<!-- Expected output is added here as a markdown codeblock -->

```
code here!
```

In some cases, `Output` tab is named as `Error` tab indicating that
an error is raised by the code.

Sometimes there may be multiple `Output` tabs to showcase different
outputs (e.g. for different inputs). In this case, each output
tab is numbered.

```md
=== "Code"

```py
num = input('enter a number:')
```

=== "Output #1"

```
enter a number: 25
```

=== "Output #2"

```
enter a number: 22
```
```
10 changes: 10 additions & 0 deletions docs/contributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributor Guide
The Python Guide is powered by and encourages community contributions. All
kind of contributions whether minor or major are welcome in this project.

- If you are looking to report or discuss error, misleading information or
simply want to suggest a new feature, please read
[**this section**](./issues.md).

- If you are looking to fix an issue or contribute a new article/section,
please start reading from [**this section**](./pull-requests.md)
26 changes: 26 additions & 0 deletions docs/contributing/issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Reporting & Discussing issues
If you have found an issue in the guide such as an error, misleading
information or incorrect information that you'd like to report
or discuss or if you simply want to suggest an addition or improvement,
this section is for you.

We use GitHub issues for issue reports, feature requests and discussions.
To open a new issue, head over to [GitHub issues](https://github.com/
thepyguide/thepyguide.github.io/issues) and create a new issue by clicking
"New issue".

Select the appropriate option depending on the type of your issue and
in the given section, describe your issue before opening it. Make sure
you include the following in your issue description:

- Source of issue (if reporting error, or misleading information e.g. the link to page having the issue)
- Detailed description of the issue.
- If you have any solution, feel free to suggest it.
- Any additional information about the issue

## Guidelines for issues
- Please check the existing issues before creating a new one to avoid
duplicate issues. Duplicate issues would be closed.
- Once an issue is created, other members can see it and provide their
feedback.
- Please keep the discussion friendly and respect feedback and opinions.
38 changes: 38 additions & 0 deletions docs/contributing/pull-requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Pull Requests

!!! note

Basic knowledge of [**Git**](https://git-scm.com/) and GitHub
is required and assumed.


If you're looking to fixing an issue, improving or contributing a new
section, this section is for you.

To start, [fork the GitHub repository](https://github.com/thepyguide/
thepyguide.github.io/fork) and clone it. It is recommended to create a new
branch in your fork to avoid conflicts and commit history issues.

To create a new branch, run the following commands in your cloned fork
git repository:
```
$ git checkout -b put-branch-name-here
```

Push the changes and open a new pull request.

## Guidelines
- All pull requests should point to the `main` branch.
- It is recommended to use past tense in your commit messages for consistency
purposes.
- Make sure to keep the scope pull request minimal. A single pull request
should focus on a single issue instead of many issues.

Above guidelines are not strict rules and any issues in pull requests
will be addressed while merging.

---

**To get a know-how of how this project is structured and the common
practices and guidelines for this project's source code, read the next
section.**
20 changes: 17 additions & 3 deletions docs/getting-started/the-first-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ first program. The moment of truth.
Create a new file in your code editor or IDE and name it `main.py`. In this file, include
your first line of Python code:

```py
print('Hello, World!')
```
=== "Code"

```py
print('Hello, World!')
```

=== "Output"

```
Hello World
```

!!! tip

Throughout this guide, code blocks are used to showcase code snippets
like the one above. Click on the `Output` tab to see the expected
output of the code.

Yep, that's it. That's the most basic Python program that outputs the given message
on screen (`Hello, World` in this case).
Expand Down
10 changes: 10 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ site_name: The Python Guide
theme:
name: material
custom_dir: docs/_templates
logo: _images/logo_header.png
favicon: _images/favicon.png
palette:
- media: "(prefers-color-scheme)"
toggle:
Expand Down Expand Up @@ -58,6 +60,7 @@ extra_javascript:

nav:
- Home: index.md
- About: about.md
- Learn Python:
- introduction.md

Expand Down Expand Up @@ -108,3 +111,10 @@ nav:
- exception-handling/else-finally-statements.md
- exception-handling/pass-statement.md
- exception-handling/common-errors.md

- Contributor Guide:

- contributing/index.md
- contributing/issues.md
- contributing/pull-requests.md
- contributing/development.md

0 comments on commit 5317171

Please sign in to comment.