Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating a doc page with autodocs and everything #3273

Merged
merged 57 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
66cc15c
add basic doc setup
Jun 19, 2023
50925f2
document __init__.py
Jun 19, 2023
f302eff
make set_proxies follow google docs format
Jun 19, 2023
ea8fe2a
code formatting
Jun 19, 2023
431b782
reconfigure index page
Jun 19, 2023
0422c0e
add grid and getting started section
Jun 19, 2023
d551b1e
remove doctree
Jun 19, 2023
cbe5322
add toctree for tutorials api and contributing
Jun 19, 2023
a047fdb
add headlines to sections
Jun 19, 2023
c67340c
remove redundant titles
Jun 19, 2023
c08adbe
add readme for gh page
Jun 19, 2023
3a5e55d
add contributing docs
Jun 19, 2023
ebfc829
fix note parsing
Jun 19, 2023
1d21ddf
add more autodoc modules
Jun 19, 2023
5261e07
limit depth in toctree
Jun 19, 2023
f35439b
fix typo
Jun 19, 2023
5b3fac6
improve docstrings of trainer.train_custom
Jun 19, 2023
82a1e0a
improve docstrings of trainer.train_custom
Jun 19, 2023
2561951
improve docstrings of trainer.train_custom
Jun 19, 2023
26f769a
improve docstrings of trainer.train_custom
Jun 19, 2023
495f4a8
make index more applicable
Jun 19, 2023
c2044a7
revert glob change
Jun 19, 2023
1650c81
remove genindex
Jun 19, 2023
2da5549
glob without genindex
Jun 19, 2023
4fdce2c
fix getting started link
Jun 26, 2023
3a4610f
fix table of content show content for respective sites (api/tutorial/…
Jun 26, 2023
b954939
better structure for embeddings
Jun 26, 2023
ac900c5
use sphinx deprecation
Jun 26, 2023
a0670cd
fine grained datasets documentation
Jun 26, 2023
09e7ceb
add tutorials
Jun 26, 2023
c12139e
deploy this branch temporarly
Jun 26, 2023
20f2c42
fix publish docs ci
Jun 26, 2023
9266587
add edit on github button
Jun 26, 2023
451e7b6
hide ToC on main page
Jul 3, 2023
61694ef
add links to api docs in tutorials
Jul 3, 2023
85c3de4
add favicon
Jul 3, 2023
8c570ce
fix sphinx warnings in docstrings
Jul 3, 2023
f010c09
fix transformer embeddings tutorial
Jul 10, 2023
67a7b2e
fix :param usage outside of datasets folder
Jul 10, 2023
0548a96
fix updating documentation syntax error
Jul 10, 2023
d04eba5
remove sidebars from index page
Jul 17, 2023
4da11a5
fix wrong link
Jul 17, 2023
20389cf
add custom version-switcher
Jul 17, 2023
08396d1
add custom pypi icon
Jul 17, 2023
177a138
fix CI-CD name
Jul 17, 2023
c86215d
add 404 redirect
Jul 17, 2023
35cf20c
global config for autodocs
Jul 24, 2023
c31ab09
add docs to variables missing
Jul 24, 2023
f1a4d96
don't use deprecated BPEmbSerializable
Jul 31, 2023
3ddc564
fix rust & mypy errors
Jul 31, 2023
c3ea2b8
fix ruff errors
Sep 11, 2023
111b0e6
update publish-docs python version
Sep 11, 2023
8d543b3
fix dependencies
Sep 18, 2023
9d49e9a
fix method references
Sep 18, 2023
64e4e8c
fix documented minimal python version
Sep 18, 2023
ac9220b
fix ruff error
Sep 18, 2023
a951be1
remove banch from doc config
Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
43 changes: 43 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Build doc page'
on:
push:
branches: [ main, doc-page ]
tags:
- "*"

jobs:
publish_docs:
name: Build the docs using Sphinx and push to gh-pages
runs-on: ubuntu-latest
env:
python-version: 3.8
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: setup python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
- name: Install Flair dependencies
run: pip install -e .
- name: Install unittest dependencies
run: pip install -r requirements-dev.txt
- name: Install doc dependencies
run: pip install -r docs/requirements.txt
- name: Fetch git tags
run: git fetch --tags origin
- name: Build docs
run: |
sphinx-multiversion docs doc_build/
- name: Add redirect to stable doc
run: |
cp assets/redirect.html doc_build/index.html
cp assets/redirect.html doc_build/404.html
cp assets/README.md doc_build/README.md
sed -i "s/\[VERSION\]/$(python -c 'import flair;print(flair.__version__)')/g" doc_build/index.html
sed -i "s/\[VERSION\]/$(python -c 'import flair;print(flair.__version__)')/g" doc_build/404.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc_build
6 changes: 6 additions & 0 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Docs For Flair NLP

This branch is currently under construction.

It will contain the docs for Flair NLP.
Don't change files, as this branch will be autogenerated using github actions.
9 changes: 9 additions & 0 deletions assets/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirecting to https://flairnlp.github.io/</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=https://flairnlp.github.io/">
<link rel="canonical" href="https://flairnlp.github.io/">
</head>
</html>
2 changes: 2 additions & 0 deletions docs/_static/api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_static/contributing.svg
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/_static/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions docs/_static/tutorial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% extends "!page.html" %}
{% block body %}
{% if current_version and latest_version and current_version != latest_version and current_version != release and current_version.name != latest_version.release %}
<p>
<strong>
{% if current_version.is_released %}
{% if latest_version.release.replace('v', '').split('.') | map('int') | list > current_version.name.replace('v', '').split('.') | map('int') | list %}
You're reading an old version of this documentation.
If you want up-to-date information, please have a look at <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% endif %}
{% else %}
You're reading the documentation for a development version.
For the latest stable version, please have a look at <a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
{% endif %}
</strong>
</p>
{% endif %}
{{ super() }}
{% endblock %}%
30 changes: 30 additions & 0 deletions docs/_templates/version-switcher.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript.
#}
<script>
document.write(`
<div class="version-switcher__container dropdown">
<button id="versionswitcherbutton" type="button" role="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="listbox" aria-controls="versionswitcherlist" aria-label="Version switcher list">
{% if current_version.is_released %} {{ current_version.name }} {% if latest_version and item == latest_version %} (stable) {% endif %} {% else %} latest (dev) {% endif %}
<span class="caret"></span>
</button>
<div id="versionswitcherlist" class="version-switcher__menu dropdown-menu list-group-flush py-0" role="listbox" aria-labelledby="versionswitcherbutton">
<!-- dropdown will be populated by javascript on page load -->
{%- for item in versions|reverse %}
<a class="list-group-item list-group-item-action py-1" href="{{ item.url }}" data-version-name="dev" data-version="devdocs">
<span>{% if item.is_released %}
{{ item.name }}
{% if latest_version and item == latest_version %}
(stable)
{% endif %}
{% else %}
latest (dev)
{% endif %}
{% if item == current_version %}
[x]
{% endif %}</span>
</a>
{%- endfor %}
</div>
</div>
`);
</script>
17 changes: 17 additions & 0 deletions docs/_templates/versioning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% if versions %}
<h3>{{ _('Versions') }}</h3>
<ul>
{%- for item in versions|reverse %}
<li><a href="{{ item.url }}">
{% if item.is_released %}
{{ item.name }}
{% if latest_version and item == latest_version %}
(stable)
{% endif %}
{% else %}
latest ({{ item.name }})
{% endif %}
</a></li>
{%- endfor %}
</ul>
{% endif %}
4 changes: 4 additions & 0 deletions docs/api/datasets/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.base
===================

.. automodule:: flair.datasets.base
4 changes: 4 additions & 0 deletions docs/api/datasets/biomedical.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.biomedical
=========================

.. automodule:: flair.datasets.biomedical
4 changes: 4 additions & 0 deletions docs/api/datasets/document_classification.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.document_classification
======================================

.. automodule:: flair.datasets.document_classification
4 changes: 4 additions & 0 deletions docs/api/datasets/entity_linking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.entity_linking
=============================

.. automodule:: flair.datasets.entity_linking
4 changes: 4 additions & 0 deletions docs/api/datasets/ocr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.ocr
==================

.. automodule:: flair.datasets.ocr
4 changes: 4 additions & 0 deletions docs/api/datasets/relation_extraction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.relation_extraction
==================================

.. automodule:: flair.datasets.relation_extraction
4 changes: 4 additions & 0 deletions docs/api/datasets/sequence_labeling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.sequence_labeling
================================

.. automodule:: flair.datasets.sequence_labeling
4 changes: 4 additions & 0 deletions docs/api/datasets/text_image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.text_image
=========================

.. automodule:: flair.datasets.text_image
4 changes: 4 additions & 0 deletions docs/api/datasets/text_text.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.text_text
=========================

.. automodule:: flair.datasets.text_text
4 changes: 4 additions & 0 deletions docs/api/datasets/treebanks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.datasets.treebanks
========================

.. automodule:: flair.datasets.treebanks
4 changes: 4 additions & 0 deletions docs/api/embeddings/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.base
=====================

.. automodule:: flair.embeddings.base
4 changes: 4 additions & 0 deletions docs/api/embeddings/document.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.document
=========================

.. automodule:: flair.embeddings.document
4 changes: 4 additions & 0 deletions docs/api/embeddings/image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.image
======================

.. automodule:: flair.embeddings.image
8 changes: 8 additions & 0 deletions docs/api/embeddings/legacy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.embeddings.legacy
============================

.. warning::
All embeddings in `flair.embeddings.legacy` are considered deprecated.
there is no guarantee that they are still working and we recommend using different embeddings instead.

.. automodule:: flair.embeddings.legacy
4 changes: 4 additions & 0 deletions docs/api/embeddings/token.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.token
======================

.. automodule:: flair.embeddings.token
4 changes: 4 additions & 0 deletions docs/api/embeddings/transformer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.embeddings.transformer
============================

.. automodule:: flair.embeddings.transformer
4 changes: 4 additions & 0 deletions docs/api/flair.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.data
==========

.. automodule:: flair.data
8 changes: 8 additions & 0 deletions docs/api/flair.datasets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.datasets
==============

.. toctree::
:glob:
:maxdepth: 2

datasets/*
8 changes: 8 additions & 0 deletions docs/api/flair.embeddings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
flair.embeddings
================

.. toctree::
:glob:
:maxdepth: 2

embeddings/*
4 changes: 4 additions & 0 deletions docs/api/flair.models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.models
============

.. automodule:: flair.models
4 changes: 4 additions & 0 deletions docs/api/flair.nn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.nn
========

.. automodule:: flair.nn
4 changes: 4 additions & 0 deletions docs/api/flair.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair
=====

.. automodule:: flair
4 changes: 4 additions & 0 deletions docs/api/flair.splitter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.splitter
==============

.. automodule:: flair.splitter
4 changes: 4 additions & 0 deletions docs/api/flair.tokenization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.tokenization
==================

.. automodule:: flair.tokenization
4 changes: 4 additions & 0 deletions docs/api/flair.trainers.plugins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.trainers.plugins
======================

.. automodule:: flair.trainers.plugins
4 changes: 4 additions & 0 deletions docs/api/flair.trainers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flair.trainers
==============

.. automodule:: flair.trainers
9 changes: 9 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
API Docs
========

.. toctree::
:glob:
:maxdepth: 2

flair
flair.*
Loading
Loading