generated from hsbasu/template-repo
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for documentation and manuals (#84)
- Separate command line args from main - Add framework to build documentation and manuals using sphinx - Fix MANIFEST file for python build
- Loading branch information
Showing
8 changed files
with
150 additions
and
10 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 = . | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Description | ||
=========== | ||
|
||
.. argparse:: | ||
:module: ThemeManager.cli_args | ||
:func: command_line_args | ||
:prog: theme-manager |
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,47 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, 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('../src')) | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'theme-manager' | ||
copyright = 'Copyright (C) 2024 Himadri Sekhar Basu' | ||
author = 'Himadri Sekhar Basu <hsb10@iitbbs.ac.in>' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
'sphinxarg.ext' | ||
] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = [] | ||
|
||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] | ||
|
||
# -- Options for manual page output --------------------------------------- | ||
|
||
# One entry per manual page. List of tuples | ||
# (source start file, name, description, authors, manual section). | ||
man_pages = [ | ||
('index', project, 'Theme Manager', [author], 1) | ||
] |
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,16 @@ | ||
.. Battery Monitor documentation master file, created by | ||
sphinx-quickstart on Sun Mar 3 09:21:34 2024. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to Theme Manager documentation! | ||
=========================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
modules | ||
|
||
Indices and 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,7 @@ | ||
Synopsis | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
ThemeManager |
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 @@ | ||
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in> | ||
# | ||
# This file is part of theme-manager. | ||
# | ||
# theme-manager is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# theme-manager is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with theme-manager. If not, see <http://www.gnu.org/licenses/> | ||
# or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
# Fifth Floor, Boston, MA 02110-1301, USA.. | ||
# | ||
# Author: Himadri Sekhar Basu <hsb10@iitbbs.ac.in> | ||
# | ||
|
||
# import the necessary modules! | ||
import argparse | ||
import gettext | ||
import locale | ||
|
||
# imports from current package | ||
from ThemeManager.common import APP, LOCALE_DIR | ||
|
||
|
||
# i18n | ||
locale.bindtextdomain(APP, LOCALE_DIR) | ||
gettext.bindtextdomain(APP, LOCALE_DIR) | ||
gettext.textdomain(APP) | ||
_ = gettext.gettext | ||
|
||
description = _('A Python3-based GUI application to change different colour variants of GTK, Icon, Cursor and other themes.') | ||
|
||
def command_line_args(): | ||
# Parse arguments | ||
parser = argparse.ArgumentParser(prog=APP, description=description, conflict_handler='resolve') | ||
|
||
# parser.add_argument('', action='store_true', dest='start_window', default=True, help=("Start Theme Manager window")) | ||
parser.add_argument('-i', '--indicator', action='store_true', dest='start_indicator', default=False, help=("Start Theme Manager Indicator")) | ||
parser.add_argument('-v', '--verbose', action='store_true', dest='show_debug', default=False, help=("Print debug messages to stdout i.e. terminal")) | ||
parser.add_argument('-V', '--version', action='store_true', dest='show_version', default=False, help=("Show version and exit")) | ||
|
||
return parser |
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