Coder Social home page Coder Social logo

crate / crate-docs-theme Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 5.0 8.44 MB

A Sphinx theme for the CrateDB documentation.

Home Page: https://crate-docs-theme.readthedocs.io/

License: Apache License 2.0

JavaScript 6.84% Python 19.59% Shell 1.07% CSS 45.00% HTML 25.77% Makefile 1.73%

crate-docs-theme's Introduction

CrateDB
https://github.com/crate/crate/workflows/CrateDB%20SQL/badge.svg?branch=master

Help us improve CrateDB by taking our User Survey!

About

CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of data in real-time.

CrateDB offers the benefits of an SQL database and the scalability and flexibility typically associated with NoSQL databases. Modest CrateDB clusters can ingest tens of thousands of records per second without breaking a sweat. You can run ad-hoc queries using standard SQL. CrateDB's blazing-fast distributed query execution engine parallelizes query workloads across the whole cluster.

CrateDB is well suited to containerization, can be scaled horizontally using ephemeral virtual machines (e.g., Kubernetes, AWS, and Azure) with no shared state. You can deploy and run CrateDB on any sort of network โ€” from personal computers to multi-region hybrid clouds and the edge.

Features

  • Use standard SQL via the PostgreSQL wire protocol or an HTTP API.
  • Dynamic table schemas and queryable objects provide document-oriented features in addition to the relational features of SQL.
  • Support for time-series data, real-time full-text search, geospatial data types and search capabilities.
  • Horizontally scalable, highly available and fault-tolerant clusters that run very well in virtualized and containerized environments.
  • Extremely fast distributed query execution.
  • Auto-partitioning, auto-sharding, and auto-replication.
  • Self-healing and auto-rebalancing.
  • User-defined functions (UDFs) can be used to extend the functionality of CrateDB.

Screenshots

CrateDB provides an Admin UI:

Screenshots of the CrateDB Admin UI

Try CrateDB

The fastest way to try CrateDB out is by running:

sh$ bash -c "$(curl -L try.crate.io)"

Or spin up the official Docker image:

sh$ docker run --publish 4200:4200 --publish 5432:5432 --env CRATE_HEAP_SIZE=1g crate -Cdiscovery.type=single-node

Visit the installation documentation to see all the available download and install options.

Once you're up and running, head over to the introductory docs. To interact with CrateDB, you can use the Admin UI sql console or the CrateDB shell CLI tool. Alternatively, review the list of recommended clients and tools that work with CrateDB.

For container-specific documentation, check out the CrateDB on Docker how-to guide or the CrateDB on Kubernetes how-to guide.

Contributing

This project is primarily maintained by Crate.io, but we welcome community contributions!

See the developer docs and the contribution docs for more information.

Security

The CrateDB team and community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.

If you think you discovered a security flaw, please follow the guidelines at SECURITY.md.

Help

Looking for more help?

crate-docs-theme's People

Contributors

agjohnson avatar amotl avatar autophagy avatar chaudum avatar dependabot[bot] avatar harryf98 avatar infoverload avatar jayeff avatar jodok avatar kevinkq avatar leph83 avatar m-kharbat avatar matkuliak avatar mfussenegger avatar msbt avatar nomicode avatar proddata avatar scjimenez avatar spanktar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crate-docs-theme's Issues

Documentation: Upgrade `docutils` package

Hi there,

docutils 0.17 starts using new semantic tags of HTML5

The current release of docutils 0.17 from 3rd April, 2021 [1] starts using the new semantic tags <main>, <section>, <header>, <footer>, <aside>, <figure>, and <figcaption>. See also sphinx-doc/sphinx#9001.

We should account for that within the CSS stylesheets here.

The release notes mention in this regard:

See minimal.css and plain.css for styling rule examples.
New optional style responsive.css, adapts to different screen sizes.

For a detailed list of changes, please see the Docutils HISTORY [2]. The corresponding upstream CSS stylesheets of the new HTML5 polyglot writer of docutils can be reviewed at [3] and the commit log at [4].

With kind regards,
Andreas.

[1] https://docutils.sourceforge.io/RELEASE-NOTES.html#release-0-17-2021-04-03
[2] https://docutils.sourceforge.io/HISTORY.html
[3] https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/html5_polyglot/
[4] https://sourceforge.net/p/docutils/code/HEAD/log/?path=/trunk/docutils/docutils/writers/html5_polyglot

Sanitize/strip HTML in "title" and "docstitle" when interpolating into Segment page title

This is a followup to #259.

@amotl @norosa there is a small problem with pages like https://crate.io/docs/crate/reference/en/4.5/sql/statements/create-table.html - the segment snippet on the rendered page looks like this:
analytics.page('<code class="docutils literal notranslate"><span class="pre">CREATE</span> <span class="pre">TABLE</span></code> - CrateDB: Reference', {

the code to display this is the one above (analytics.page('{{ title }} - {{ docstitle }}', {), any idea how to sanitize this properly to remove the html tags?

Originally posted by @msbt in #259 (comment)

CSS minification should be handled by the build system

02bcb18 introduced CSS minification. however, it looks like @msbt minified the CSS by hand. the result is that if you edit the source CSS files, your changes will not have any effect. the theme only reads the minified CSS and ignores the source CSS (which is working as intended)

we need a way of developing the CSS that doesn't require you to minify the CSS by hand every time you make a change. people who know you have to do this are likely to forget occasionally. and people who don't know this are likely to be confused about why their changes are not showing up

I am not sure what CSS minification tool @msbt used. we need to identify what tool to use before we can implement a build rule for doing this

I am guessing that the command to minify the CSS ought to be added after:

@ $(MAKE) clean

and before:

. $(ACTIVATE) && \

no other changes ought to be necessary. the Makefile in docs uses the crate-docs-theme package that is built in the parent directory, so any changes made to that package will show up when you view the test docs (as long as a make reset is run every time changes are made, to clear the local Python package cache).


this issue came up while working on https://github.com/crate/tech-writing-domain/issues/382

as an interim workaround, I plan to fix the CSS issue I am working on and generate a new minified CSS by hand and check it into the repository to replace the existing one

Add Margin to code highlights for better readability

Right now a new paragraph follow directly after code-highlights, which makes articles hard(er) to read. Therefore I propose we add a margin at the bottom of code-highlights of 16px (same as <p>aragraphs.

Left without margin at the bottom (old) / right with margin at bottom (new)
image

current-active class is not set on CrateDB Cloud / How-To Guides

When browsing the docs I realized that the second How-To Guides (from the Cloud) is not highlighted when active:

grafik

Not sure why this is happening, compared a few things but the project names are different (https://github.com/crate/crate-docs-theme/blob/master/src/crate/theme/rtd/crate/sidebartoc.html#L12 for CrateDB and https://github.com/crate/crate-docs-theme/blob/master/src/crate/theme/rtd/crate/sidebartoc.html#L65 for CrateDB Cloud).

document how to use PyPI

python setup.py sdist upload will error out the first time you run it if you've not used PyPI before. so we should point to instructions on how to set that stuff up (from what I can tell atm it just involves creating a dotfile)

The version drop-down menu no longer works

Steps to reproduce:

  1. visit any page, e.g., https://crate.io/docs/crate/reference/en/4.5/index.html
  2. click the version drop-down menu (at time of writing, the menu selection defaults to "v:4.5")

What happens:

  • nothing

What I expect to happen:

  • the drop-down menu shows me a list of available versions that I can select from

Tested using:

  • Chrome on macOS (with hard refresh and incognito mode)
  • Safar on macOS (ditto)

More:

I see lots of errors (or things that look like issues) in the dev console. I expect this relates to #277. however, clicking the drop-down does not produce any new errors in addition to the messages that already appear

Add the page title to Segment tracking

We just realized that all docs pages are getting the title "visited_section_docs" in Analytics, because of this line here: https://github.com/crate/crate-docs-theme/blob/master/src/crate/theme/rtd/crate/layout.html#L191

We specifically tell Segment to use that as the page title via analytics.page('visited_section_docs'...

I was playing around with it locally and analytics.page('{{ title }} - {{ docstitle }}', { already seems to give more information, but since this is only a local demo, I don't know if those are the correct tags. Can anyone confirm or suggest better title options?

Cheers, M

Compatibility with Sphinx 3.x

Hi there,

we found building the docs to fail on crate/crate when upgrading to Sphinx 3.x, see [1]. While I can confirm it happened there [2], I can also confirm it works just fine when following these steps.

Setup

https://github.com/crate/crate
cd crate
virtualenv .venv --python=python3.8
source .venv/bin/activate
pip install -r docs/requirements.txt
pip install sphinx==3.3.1

Check versions

sphinx-build --version
sphinx-build 3.3.1
>>> import crate.theme.rtd
>>> crate.theme.rtd.VERSION
(0, 11, 0)

Build the docs

sphinx-build -n -W --keep-going -c docs/ -b html -E docs/ docs/out/html
open docs/out/html/index.html

With kind regards,
Andreas.

[1] crate/crate#10831 (comment)
[2] https://jenkins.crate.io/blue/organizations/jenkins/CrateDB%2Fcrate_on_pr/detail/crate_on_pr/12338/pipeline

update docs and build to account for removal of LESS

we stopped compiling LESS to CSS in 0.5.0 apparently, but it looks like the README.rst and Gruntfile.js (and perhaps some other things) were not updated. these should be updated. perhaps we want to remove Grunt entirely?

add "team: tech writing" label to new feedback issues

at the moment, the feedback section adds "area: docs" but this is not sufficient for it to automatically pop up on the tech writing project board "add cards" default search

the theme should be modified so that creating a new feedback issue adds the "team: tech writing" label

Fix and improve OpenGraph metadata

Hi there,

#269 adds OpenGraph metadata to each documentation page. When looking at the respective information on https://crate.io/docs/crate/tutorials/en/latest/, this produces:

<meta property="og:title" content="CrateDB Tutorials" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://crate.io/index.html" />
<meta property="og:site_name" content="CrateDB documentation" />
<meta property="og:description" content="CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of machine data in real-time. Table of contents Installation, First use, Create user, Create sharded table, Generate time series data, Normalize time series data intervals." />
<meta property="og:image" content="https://user-images.githubusercontent.com/453543/119536319-3c9ca480-bd89-11eb-908d-3da78e55f17b.png" />

From my perspective, <meta property="og:url" content="https://crate.io/index.html" /> is wrong. Following this link will yield a 404 page.

With kind regards,
Andreas.

sort out top level docs

at the moment, information for project devs is confusingly half-duplicated between README.rst and DEVELOP.rst. this info should be collected in just README.rst or properly yanked out and kept in DEVELOP.rst with a note in `README.rst

improve link syles

some subheadings get a blue color instead of a black color. all headings should be black

Use theme to set all requirements for Crate Sphinx projects

I am creating this issue to address the underlying cause of crate/crate-jdbc#342.

Summary of the problem

How dependency resolution is done at build time

  • When RTD tries to build a Sphinx project, it reads the requirements from docs/requirements.txt.

    See below for examples.

  • Every docs/requirements.txt file specifies the crate-docs-theme.

    Some (most?) docs/requirements.txt files also specify additional dependencies (for example, to pin a specific version of sphinx)

  • The crate-docs-theme package setup.py file includes an install_requires list that also specifies dependencies (for example, to pin a specific version of sphinx).

Degrees of freedom

  • The specifications in docs/requirements.txt are fixed to the HEAD commit of the branch you are trying to build. There is no way to alter this configuration without updating the HEAD commit.

    For main or master, this typically isn't an issue.

    For release branches, this will involve a cherry-pick backport. Sometimes, backporting a simple docs configuration change to an older release branch of a software project causes unrelated test failures for the main project code. This can happen when the new test environment that was created to test the PR pulled in newer dependencies that were used before. These newer dependencies may introduce breaking changes, regressions, and so on. This typically requires one of the core project maintainers to spend some time fixing a bunch of unrelated project code tests.

  • The specifications listed in setup.py vary across versions of the crate-docs-theme package.

    When Pip is trying to satisfy the two sets of requirements, the only option at build time is to cycle through older versions of the crate-docs-theme package until one is found that does not conflict with docs/requirements.txt.

Conclusion

  • Any time docs/requirements.txt lists a package already listed as a dependency of the crate-docs-theme package (via setup.py), you open yourself up to "surprise" builds where RTD selects an old version of the theme. This will result in one or more of the live documentation projects using an out-of-date design (breaking seamless integration with the rest of the website).

    See crate/crate-jdbc#342 for an example of this.

Review of all docs/requirements.txt files

crate

# packages for RTD to pick up (not used for local dev)
crate-docs-theme>=0.12.0
sphinx-csv-filter
Pygments>=2.7.4,<3

crate-tutorials

sphinx==3.5.4
docutils==0.16
crate-docs-theme

crate-howtos

crate-docs-theme

crate-clients-tools

crate-docs-theme

crash

crate-docs-theme

admin-ui

crate-docs-theme

crate-python

crate-docs-theme

crate-jdbc

# don't pin crate version numbers so the latest will always be pulled when you
# set up your environment from scratch

crate-docs-theme>=0.7

# packages for local dev

sphinx-autobuild==0.6.0

# the next section should mirror the RTD environment

alabaster>=0.7,<0.8,!=0.7.5
setuptools<41
sphinx==1.8.5

crate-dbal

crate-docs-theme

crate-pdo

crate-docs-theme

crate-npgsql

crate-docs-theme

cloud-tutorials

crate-docs-theme

cloud-howtos

crate-docs-theme

cloud-reference

crate-docs-theme

croud

# Standard packages needed for the docs
###############################################################################

crate-docs-theme


# Project specific packages
###############################################################################

# Pip is run from the root directory, so this installs the `croud` package
.
sphinx-argparse==0.2.5

sql-99

crate-docs-theme

crate-docs

sphinx==3.5.3
crate-docs-theme

crate-docs-theme

# Install the local crate-docs-theme package by specifying parent directory,
# because `pip` is run from there.
--editable=.
sphinx==3.5.4
docutils==0.16

Proposed solution

Premise:

  • The crate-docs-theme should specify all requirements in the setup.py file and the Sphinx project-specific docs/requirements.txt file should only list a single dependency: crate-docs-theme (not pinned to any version, so the latest is always used).

Some of the projects already do this (see above).

To complete this work, I propose that we:

  • Update all docs/requirements.txt files so they only specify crate-docs-theme as a dependency
    • Backport this change to active release branches as necessary

Projects needing updates as above:

The theme also needs updating:

  • crate-docs-theme

    However, the crate-docs-theme docs/requirements.txt file is an exception.

    The --editable=. essentially installs the crate-docs-theme package from the parent directory, so that you can test changes to theme by building the docs. This line should stay. The next two lines (sphinx and docutils) can probably be removed.

Move segment configuration out of base template

there are a few third-party sites that are using an adapted version of this theme. unfortunately, because we embed our segment tracking directly into the HTML, this is segment tracking code is being executed on these third-party sites, which is throwing off our analytics

@autophagy suggests the following:

Would it not be possible to just remove it from here:

'tracking_segment_id': 'FToR4cE5lXyQziQirvt0kSnFQj0rAgu9',

and instead, have it an option in the conf.py files that each project has? Like: https://github.com/autophagy/faereld/blob/master/seonu/conf.py

For example, I just changed the conf.py file for the crate-howtos repo (https://github.com/crate/crate-howtos/blob/master/docs/conf.py) to:

from crate.theme.rtd.conf.crate_howtos import *

html_theme_options = {
    'tracking_segment_id': 'hello world!'
}

and built the project, which resulted in this in the source:

image

bootstrap error

trying to get this project working locally for the first time

per the README, I ran this command:

$ python bootstrap.py
Downloading https://pypi.io/packages/source/s/setuptools/setuptools-32.3.1.zip
Extracting in /var/folders/1x/n4sv5tvj2v1bzgrhqjqnc7sc0000gn/T/tmp4_4x145l
Now working in /var/folders/1x/n4sv5tvj2v1bzgrhqjqnc7sc0000gn/T/tmp4_4x145l/setuptools-32.3.1
Building a Setuptools egg in /var/folders/1x/n4sv5tvj2v1bzgrhqjqnc7sc0000gn/T/bootstrap-90r7z09s
warning: no files found matching '*' under directory 'setuptools/_vendor'
/var/folders/1x/n4sv5tvj2v1bzgrhqjqnc7sc0000gn/T/bootstrap-90r7z09s/setuptools-32.3.1-py3.5.egg
Creating directory '/Users/nslater/Documents/Managed/Repos/GitHub/crate/crate-docs-theme/eggs'.
Creating directory '/Users/nslater/Documents/Managed/Repos/GitHub/crate/crate-docs-theme/bin'.
Creating directory '/Users/nslater/Documents/Managed/Repos/GitHub/crate/crate-docs-theme/parts'.
Creating directory '/Users/nslater/Documents/Managed/Repos/GitHub/crate/crate-docs-theme/develop-eggs'.
Generated script '/Users/nslater/Documents/Managed/Repos/GitHub/crate/crate-docs-theme/bin/buildout'.

I then tried this:

$ bin/buildout -N
Traceback (most recent call last):
  File "bin/buildout", line 9, in <module>
    import zc.buildout.buildout
ImportError: No module named 'zc.buildout'

any idea why this isn't working?

Set description content type

when building, this warning pops up:

. .env/bin/activate && \
	    .env/bin/twine check .dist/*
Checking .dist/crate_docs_theme-0.10.17-py3-none-any.whl: PASSED, with warnings
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Checking .dist/crate-docs-theme-0.10.17.tar.gz: PASSED, with warnings
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.

document how to test the theme

the recommended way to make changes to the theme and test them is to copy the docs folder from crate/blackbox into the crate-docs-theme root directory. I don't think symlinks work. and atm some files need editing. either way this should be documented

Get rid of Webflow library

The patch #283 inlines the webflow.js file from an earlier revision as we have not been able to find it back anywhere upstream. It weighs in with 140k(!). We might want to get rid of this.

As we learned from #281, it is currently still needed by the version picker drop-down menu and probably also other elements. References to other CSS classes prefixed with w-, implemented by Webflow, can be found within navbar.html and layout.html.

sphinx-copybutton does not copy empty lines

Hi there,

we are observing the problem mentioned at executablebooks/sphinx-copybutton#84 here.

For example, the code block at [1] will not get copied "as-is", all empty lines are missing. The config entries within conf.py we are currently using can be reviewed at [2].

With kind regards,
Andreas.

[1] https://crate.io/docs/python/en/latest/sqlalchemy.html#tables
[2] https://github.com/crate/crate-docs-theme/blob/0.15.1/src/crate/theme/rtd/conf/__init__.py#L112-L115

Add meta description, OpenGraph and/or Twitter cards for better visibility in search engines

As suggested here, the SEO of our docs could do with a little improvement. Apparently the og stuff doesn't work out of the box, that's why the build process needs an update:

For OpenGraph, there's a Sphinx extension.

The meta description could/should be added like this via RST: https://docs.readthedocs.io/en/stable/guides/technical-docs-seo-guide.html#use-meta-tags

On the main website we use this as our default image for og/meta/twitter cards: https://crate.io/wp-content/uploads/2020/10/crateio-logo.png

Broken rendering?

Hi there,

@proddata just shared this screenshot with me. It shows scrambled garbage output when visiting the documentation space.

According to his report, it only happens on https://crate.io/docs/crate/tutorials/. He has been able to verify it on two different devices using two different internet connections. On the other hand, I have not been able to reproduce it in any way.

image

With kind regards,
Andreas.

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.