Skip to content

Commit 4a2e180

Browse files
Update: 📖 readthedocs documentation added
1 parent 82fc427 commit 4a2e180

File tree

13 files changed

+268
-0
lines changed

13 files changed

+268
-0
lines changed

.readthedocs.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
13+
14+
# Build documentation in the "docs/" directory with Sphinx
15+
sphinx:
16+
configuration: docs/conf.py
17+
18+
# Optionally build your docs in additional formats such as PDF and ePub
19+
formats:
20+
- pdf
21+
- epub
22+
23+
python:
24+
install:
25+
- requirements: docs/requirements.txt

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/custom.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Navbar customization */
2+
.navbar .toc {
3+
display: none; /* This will hide the TOC */
4+
}
5+
.navbar a {
6+
color: #007bff; /* Link color */
7+
padding: 10px 15px; /* Padding around links */
8+
}
9+
10+
.navbar a:hover {
11+
background-color: #e2e6ea; /* Background color on hover */
12+
color: #0056b3; /* Darker link color on hover */
13+
}
14+
15+
.navbar .navbar-brand {
16+
font-weight: bold; /* Bold brand name */
17+
}
18+
19+
/* Responsive adjustments */
20+
@media (max-width: 768px) {
21+
.navbar {
22+
flex-direction: column; /* Stack items vertically on small screens */
23+
}
24+
}

docs/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Changelog
2+
=========
3+
4+
0.0.1 (2025-05-24)
5+
------------------
6+
7+
- Initial release of the project.
8+
- Added basic functionality for the main feature.

docs/cli_reference.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CLI Reference
2+
=============
3+
4+
Basic commands:
5+
6+
.. code-block:: bash
7+
8+
extliner --help
9+
10+
Options include:
11+
12+
- `-i`, `--ignore` : Ignore specific extensions (e.g., `.log,.tmp`).
13+
- `-j`, `--json` : Print output in JSON.
14+
- `-v`, `--verbose` : Show detailed processing information.

docs/conf.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
from datetime import datetime
2+
3+
project = 'extliner'
4+
release = '0.0.1'
5+
year = datetime.now().year
6+
copyright = f"{year} CodePerfectPlus"
7+
8+
# Paths and source setup
9+
templates_path = ['_templates']
10+
source_suffix = ".rst"
11+
master_doc = "index"
12+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
13+
html_static_path = ['_static']
14+
15+
# Extensions for Sphinx
16+
extensions = [
17+
'sphinx.ext.autodoc', # Generate docs from docstrings
18+
'sphinx.ext.todo', # Support TODO directives
19+
'sphinx.ext.coverage', # Documentation coverage
20+
'sphinx.ext.viewcode', # Link to source code in docs
21+
'sphinx.ext.autosectionlabel', # Reference sections automatically
22+
'sphinx.ext.githubpages', # GitHub Pages support
23+
]
24+
25+
# Avoid ambiguous section labels
26+
autosectionlabel_prefix_document = True
27+
28+
# PDF generation (optional)
29+
pdf_documents = [
30+
('index', 'Extliner_Documentation', 'Extliner Docs', 'Extliner Team')
31+
]
32+
33+
# GitHub releases integration
34+
releases_github_path = "codeperfectplus/extliner"
35+
releases_unstable_prehistory = True
36+
37+
# HTML output options
38+
html_theme = 'pydata_sphinx_theme' # Nice modern theme, alternatives: 'sphinx_rtd_theme'
39+
html_theme_options = {
40+
"show_prev_next": True,
41+
"navigation_depth": 4,
42+
"collapse_navigation": True,
43+
"navbar_align": "content",
44+
"show_nav_level": 2,
45+
"icon_links": [
46+
{
47+
"name": "GitHub",
48+
"url": "https://github.com/codeperfectplus/extliner",
49+
"icon": "fab fa-github",
50+
"type": "fontawesome"
51+
},
52+
{
53+
"name": "Releases",
54+
"url": "https://github.com/codeperfectplus/extliner/releases",
55+
"icon": "fas fa-tag",
56+
"type": "fontawesome"
57+
}
58+
],
59+
"use_edit_page_button": True,
60+
}
61+
62+
# GitHub edit button context
63+
html_context = {
64+
"github_user": "codeperfectplus",
65+
"github_repo": "extliner",
66+
"github_version": "main",
67+
"doc_path": "docs",
68+
}
69+
70+
# Sidebars config
71+
html_sidebars = {
72+
'**': [
73+
'globaltoc.html',
74+
'relations.html',
75+
'sourcelink.html',
76+
'searchbox.html'
77+
]
78+
}
79+
80+
# Additional CSS files (add custom styles if any)
81+
html_css_files = [
82+
'custom.css',
83+
]

docs/contributing.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Contributing
2+
============
3+
4+
We welcome contributions!
5+
6+
1. Fork the repository and clone it locally.
7+
2. Create a new feature branch.
8+
3. Add tests and ensure existing tests pass.
9+
4. Follow PEP8 style guidelines.
10+
5. Submit a pull request for review.

docs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. rst-class:: hide-header
2+
3+
Welcome to Extliner documentation!
4+
==================================
5+
6+
.. image:: https://pepy.tech/badge/extliner
7+
:alt: Download badge
8+
:target: https://pepy.tech/project/extliner
9+
10+
Extliner is a lightweight CLI tool for analyzing and counting lines of code in your projects efficiently.
11+
12+
.. toctree::
13+
:maxdepth: 2
14+
:caption: Contents:
15+
16+
installation
17+
usage
18+
cli_reference
19+
contributing
20+
changelog

docs/installation.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Installation
2+
============
3+
4+
Install Extliner easily with pip:
5+
6+
.. code-block:: bash
7+
8+
pip install extliner
9+
10+
Requirements:
11+
- Python 3.6+

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)