Giter VIP home page Giter VIP logo

thecarisma / themata Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 1.72 MB

Set of Highly customizable and responsive sphinx themes. hackish, milkish, fandango, clear, fluid, garri, water and sugar.

Home Page: https://thecarisma.github.io/themata

License: Creative Commons Zero v1.0 Universal

Python 99.02% Batchfile 0.48% Makefile 0.50%
sphinx theme python documentation ratio restructuredtext thecarisma

themata's Introduction

Thecarisma.themata

themata

https://img.shields.io/pypi/dw/themata?style=for-the-badge:alt:PyPI-Downloads:target:https://pypi.org/project/themata/

https://img.shields.io/travis/thecarisma/themata?style=for-the-badge:alt:Travis(.org)branch:target:https://travis-ci.org/github/Thecarisma/themata

Set of Highly customizable sphinx themes.

Overview

This package contains different sphinx theme that can be easily customized to look like a complete website or just a documentation webpage.

To use one of the theme install the themata package from python index.

pip install themata

or equivalent (add themata to any appropriate requirements files).

The following themes are implemented in the project. Follow the link for detail documentation for each of the themes.

To use one of the them install the themata package, and specify the theme to use in the conf.py file.

Example

To use the milkish theme, set the following option in your conf.py file.

import os
import themata

project = 'First Doc'
copyright = '2020, Adewale Azeez'
author = 'Adewale Azeez'
html_favicon = 'favicon.png'

html_theme = 'milkish'

Each of the themes has theme options to customize the look of the generated pages. The options for each of the themes can be view on their documentation page (links above).

Documentation

The full documentation is at https://thecarisma.github.io/themata. To read the documentation offline run the gendoc.bat command in the docs/ folder to generate a dist folder.

How it works

In each of the theme folder, the theme.conf is used to declare the the defult theme options, the layout.html file is the template for all the generated pages in the theme. The __init__.py file is where the theme and it version is added to sphinx. static*.css_t is the cascaded style sheet template for the theme.

Contributing

Fork the project clone the test branch to view the static test folder which is used as template for the main theme module in themata. Copy one of the static folder change the css to suite your need, then make a copy of one of the theme in themata folder then add your static css file ending with .css_t. Write a documentation for the new theme in the doc folder. Send in a PR if it OK it will be merged into the main project.

If you have any feature request or issue, open a new issue here.

Useful Links

License

Creative Commons Zero v1.0 Universal License. Copyright (c) 2020 Adewale Azeez

Change Log

1.13
  • makes left sidebar and header of water theme fixed #11 8346703
  • addd colapsible sidebar theme option to water theme cb95e5f
  • navbar links now accept relative and absolute links instead of absolute only #15 f1acf57
  • update the layout.html to add proper source suffix for edit page 0cd48d6
1.11
  • reduce margin and spacing the code block d942fdb
  • add theme options to customize note, warning, seealso and topic background and border #6 befd80a
  • add the documentation for theme option cutomize the table row background ba46635
  • fix table overflow, table customization should be done by user with custom css #8 a02e558
  • add support for metadata and twitter_metadata #9 79d50a9
  • add support for metadata and twitter_metadata #9 21393b4
  • add support for metadata and twitter_metadata #9 b59ae69
  • make the title bold and reduce the monstrous padding in code block. #12 23e5336
  • make the title bold and reduce the monstrous padding in code block ac160e9
  • modify the table css to make it look more clean and stylish 36a71d4
  • change the style of the code rendering e78e1c7
1.1
  • Remove <no title> from pages with no title. If no title set title to page or project name 731e51d
  • Add theme option to set the document font-size aefa7ac
  • Add theme option document font-size to each theme documentation a474591
  • Put note on top of each theme page that link back to themata 8b3bc8d
  • Make the document occupy 100% in sugar theme if left and right sidebar is disabled 439fd97
  • Add optional 'edit this page' button to webpages e.g. edit on github df0987c
  • Add source_root option for the edit on link and source_root_edit_text for the text to display to theme option df0987c
  • Document the source_root and source_root_edit_text theme options e9ea268

# TODO

Use a script to generate pymodule from the test folder

themata's People

Contributors

thecarisma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

themata's Issues

add the social medias card metadata for the webpages, optional

<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@flickr" />
<meta name="twitter:title" content="Small Island Developing States Photo Submission" />
<meta name="twitter:description" content="View the album on Flickr." />
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg" />

can be set in the conf.py as

html_theme_options = {
   "has_twitter_meta_data": True,
   "twitter_handle": "@themata",
   "twitter_meta_data": {
      "card": "",
      "site": "",
      "title": "",
      "description": "",
      "image": "",
   }
}

The default card value is summary, default site is the twitter handle of the website, the default title is the title of the project, the default description is the website description the default image is the site icon. The fields are optional.

See https://cards-dev.twitter.com/validator https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary

Add new themes

Enable dark theme mode in the web pages.

Use Javascript to toggle dark and light theme on a webpage on a button click. Also somehow store the theme preference.

Instead of using more than one CSS file to switch themes, use the html_theme_options variable to set options for the dark theme.

html_theme_options = {
    'dark_theme': {
        'text_color': 'white',
        'background_color': 'black'
    }
}

Write python script to generate a sphinx theme from a saved html page

Create a python script that auto-generates an HTML page as distributable and installed the sphinx theme. Use the script to generate a new theme for thematic collection and allow the script to be capable of generating a single sphinx theme for a saved HTML page.

Scenario 1

If the page https://docs.github.com/en is saved as HTML, the script will generate a sphinx theme that can generate a doc in the save Github doc design.

Scenario 2

If the page https://docs.github.com/en is saved as HTML, the script will generate a sphinx theme for part of the themata collection, this is exclusive to the themata collection only.

Features

  • Can generate a random name from the page or title, between 5 - 6 letters long
  • Generates completely usable python sphinx theme
  • Allows customizing the layout properties automatically base on the themata framework and APIs.
  • Allows customizing the CSS and JS to auto-generate theme_options
  • Can generate a showcase like documentation page for the generated theme base on themata API
  • Scenario 1 functional
  • Scenario 2 functional
  • Add a label or detail on the page (a standalone likely) that shows it generated by themata
  • Warn user if the HTML page already has a theme in themata
  • Build a Tkinter GUI to perform the operations
    • Download the webpage
    • Set the theme options using themata API and frameworks for
      • layout
      • JS
      • CSS
    • all the main features operations above

TODO

  • Rewrite all existing themata themes to be auto-generated by the script without breaking backward compatibility
  • Generate the new themes from the issue #32 with the script
  • Record the page that a theme is derived from in themata for warning

Add theme option for custom css to dump in head

theme option to dump in head

html_theme_options = {
   "custom_css": "h2 { font-weight: bold;}"
}

Will be dump in generated webpage head like

<head>
<!-- ...-->
<style>
h2 { font-weight: bold;}
</style>
</head>

Auto navigate to the div if highlight

Automatically navigate to the section on the webpage if the highlight param is set in the URL. e.g. macros.html?highlight=cester_no_print_info should navigate to the cester_no_print_info section.

Remove text-shadow from heading

.bodywrapper h1,
.bodywrapper h2,
.bodywrapper h3,
.bodywrapper h4,
.bodywrapper h5,
.bodywrapper h6 {
    text-shadow: 0px 0px 0 white !important;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.