diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml new file mode 100644 index 0000000000..02219db4e1 --- /dev/null +++ b/.github/workflows/test-docs.yml @@ -0,0 +1,52 @@ +name: 'Build doc page for artifact' +on: + push: + branches: "*" + +jobs: + build_docs: + name: Build the docs using Sphinx and publish as artifact + runs-on: ubuntu-latest + env: + python-version: 3.9 + 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 Torch cpu + run: pip install torch --index-url https://download.pytorch.org/whl/cpu + - 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: Change config to current branch + env: + BRANCH_NAME: ${{ github.ref_name }} + run: | + sed -i 's/^smv_branch_whitelist = r"^master$"/smv_branch_whitelist = r"^${{ env.BRANCH_NAME }}$"/' docs/conf.py + sed -i 's/^smv_tag_whitelist = r"^v\d+\.\d+\.\d+$"/smv_tag_whitelist = "^$"/' docs/conf.py + cat docs/conf.py + - name: Build docs + run: | + sphinx-multiversion docs doc_build/ + - name: Add redirect to stable doc + env: + BRANCH_NAME: ${{ github.ref_name }} + 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\]/${{ env.BRANCH_NAME }}/g" doc_build/index.html + sed -i "s/\[VERSION\]/${{ env.BRANCH_NAME }}/g" doc_build/404.html + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: website + path: doc_build \ No newline at end of file diff --git a/docs/_static/css/api.css b/docs/_static/css/api.css new file mode 100644 index 0000000000..e0e35f3a96 --- /dev/null +++ b/docs/_static/css/api.css @@ -0,0 +1,213 @@ +.sidebar-primary-item .docutils::before { + content: none; +} + +.sidebar-primary-item .docutils .pre { + font-family: "Afacad", sans-serif; + font-size: 1rem; + text-overflow: ellipsis; +} + +.sig { + color: var(--blue-white); + font-family: "Source Code Pro", monospace; + line-height: 2em; + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.sig span.pre { + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.sig .linkcode-link { + padding: 0; + display: inline-block; + width: 1rem; + height: 1rem; + transform: translateY(10%) scale(1.5); +} + +.sig .linkcode-link .pre { + display: none; +} + +.sig .linkcode-link::after { + content: ""; + background-image: url("../../_static/octocat.svg"); + background-size: cover; + display: inline-block; + width: 100%; + height: 100%; +} + +.sig-name.descname { + color: var(--flair-orange); +} + +.sig { + margin-top: 2rem; + margin-bottom: .5em; + padding-bottom: .5em; + padding-top: .5em; +} + +.sig:target { + background: rgba(47, 46, 65, 0.15); + border-radius: .5rem; +} + +:root .dark-mode .sig:target { + background: rgba(255, 255, 255, 0.15); +} + +.class dd, .method dd, .function dd, .data dd { + margin-left: 0 !important; + padding-left: 3rem !important; + border-left: 2px var(--gray-white) solid; +} + +.class dd dl.field-list, .method dd dl.field-list, .function dd dl.field-list, .data dd dl.field-list { + background-color: transparent; + border: 2px var(--flair-orange) solid; + border-radius: 1rem; + padding: 1rem 1.5rem; +} + +.class dd dl.field-list ul, .method dd dl.field-list ul, .function dd dl.field-list ul, .data dd dl.field-list ul { + padding-left: 0 !important; +} + +.class dd dl.field-list dt, .method dd dl.field-list dt, .function dd dl.field-list dt, .data dd dl.field-list dt { + background-color: transparent !important; + color: var(--blue-white); + font-weight: 600; + font-size: 1.5rem; + padding: 0 !important; + margin: 0 !important; +} + +.class dd dl.field-list dd, .method dd dl.field-list dd, .function dd dl.field-list dd, .data dd dl.field-list dd { + margin: 0 !important; + padding: 0 !important; + border-left: none; +} + +.class .n, .method .n, .function .n, .data .n { + color: #2AACB8; +} + +.class .default_value, .method .default_value, .function .default_value, .data .default_value { + color: #8888C6; +} + +div.deprecated { + box-shadow: none !important; + background: var(--error-red); + border: 2px var(--error-red) solid; + border-radius: 1rem; + padding: 0.5em 2.2em 0 2.2em; + box-sizing: border-box; +} + +div.deprecated p span.versionmodified.deprecated::before { + color: white; +} + +div.deprecated p::before { + content: none; +} + +a.github::before { + content: ""; + height: 1em; + width: 1em; + display: inline-block; + background-image: url("../../_static/octocat.svg"); + background-size: contain; + background-position: center; + transform: translateY(25%); +} + +blockquote { + font-family: "Source Code Pro", monospace; + border-radius: 1rem; + padding: 1.1em 1.5em; + background: var(--gray-dark-blue); + color: var(--blue-white); +} + +blockquote::before { + content: none; +} + +blockquote p { + margin: 0 !important; +} + +.rubric { + font-size: 2rem; + margin: 1em 0 .5em 0 !important; + border-bottom: none !important; +} + +table.autosummary { + margin-top: 1.5em; +} + +table.autosummary .field-list { + margin-bottom: 0.5rem; + display: flex !important; + font-size: 1rem; +} + +table.autosummary .field-list *:not(code) { + font-size: inherit !important; +} + +table .field-odd, table .field-even { + color: var(--blue-white); + font-family: "Afacad", sans-serif; +} + +table .field-odd p, table .field-even p { + margin: 0 !important; +} + +table p:empty { + display: none; +} + + +@media screen and (max-width: 1200px) { + .class dd, .method dd, .function dd, .data dd { + padding-left: 1.5rem !important; + } +} + +@media screen and (max-width: 900px) { + .sig, .sig * { + font-size: .8rem; + } + + .class dd dl.field-list, .method dd dl.field-list, .function dd dl.field-list, .data dd dl.field-list { + padding: 1rem; + } +} + +@media screen and (max-width: 400px) { + dl * { + font-size: .8rem !important; + } + + dl code { + font-size: .6rem !important; + } + + .class dd, .method dd, .function dd, .data dd { + padding-left: 1rem !important; + } +} \ No newline at end of file diff --git a/docs/_static/css/footer.css b/docs/_static/css/footer.css new file mode 100644 index 0000000000..a5c39f7e40 --- /dev/null +++ b/docs/_static/css/footer.css @@ -0,0 +1,72 @@ +.bd-footer { + border: none; + background: var(--blue-orange); + height: var(--footer-height); + display: flex; + align-items: center; +} + +.bd-footer *::selection { + background: var(--white-blue); + color: var(--flair-orange); +} + +.bd-footer .bd-footer__inner { + padding: 0 10%; + width: 100%; + max-width: initial; + margin: 0; + box-sizing: border-box; +} + +.bd-footer .bd-footer__inner .footer-item * { + color: white; +} + +.bd-footer .bd-footer__inner a:hover { + color: var(--orange-blue); +} + +.bd-footer .bd-footer__inner .footer-items__end { + display: flex; + flex-direction: row; +} + +.bd-footer .bd-footer__inner .footer-items__end .footer-item:not(:last-of-type) { + margin-right: 3rem; +} + +@media screen and (max-width: 959px) { + .bd-footer { + font-size: 0.8rem; + } + + .bd-footer .bd-footer__inner .footer-items__end .footer-item:not(:last-of-type) { + margin-right: 2rem; + } +} + +@media screen and (max-width: 700px) { + .bd-footer { + font-size: 1rem; + } + + .bd-footer .bd-footer__inner .footer-items__start { + display: none; + } + + .bd-footer .bd-footer__inner .footer-items__end { + width: 100%; + justify-content: space-between; + } + + .bd-footer .bd-footer__inner .footer-items__end .footer-item:not(:last-of-type) { + margin-right: 1rem; + } +} + +@media screen and (max-width: 435px) { + .bd-footer { + font-size: 0.8rem; + } +} \ No newline at end of file diff --git a/docs/_static/css/header.css b/docs/_static/css/header.css new file mode 100644 index 0000000000..22866f9f1a --- /dev/null +++ b/docs/_static/css/header.css @@ -0,0 +1,233 @@ +.bd-header { + width: 100%; + height: var(--header-height); + background: var(--flair-orange) !important; + box-shadow: none; +} + +.bd-header *::selection { + background: var(--white-blue); + color: var(--flair-orange); +} + +.bd-header .bd-header__inner { + margin: 0 10%; + padding: 0; + height: 100%; + width: 100%; + max-width: initial; + display: flex; + justify-content: space-between; +} + +.bd-header .bd-header__inner .navbar-header-items__start { + padding: 0; + height: 55%; +} + +.bd-header .bd-header__inner .navbar-header-items__start .navbar-item { + height: 100%; +} + +.bd-header .bd-header__inner .navbar-header-items__start .navbar-item .navbar-brand.logo { + height: 100%; + padding: 0; + display: block; +} + +.bd-header .bd-header__inner .navbar-header-items__start .navbar-item .navbar-brand.logo .logo__image { + height: 100%; + width: auto; +} + +.bd-header .bd-header__inner nav { + height: 100%; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements { + display: flex; + height: 100%; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item { + height: auto; + display: flex; + align-items: center; + margin-right: 0; + margin-left: 3rem; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item.active a { + font-weight: inherit; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item.active a::after { + width: 100%; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item a { + position: relative; + font-size: 1.1rem; + padding: 0; + color: white; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item a:hover { + color: white; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item a:hover::after { + width: 100%; +} + +.bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item a::after { + transition: width 200ms cubic-bezier(0, 0.35, 0.08, 0.89); + content: ""; + width: 0; + height: 2px; + background-color: white; + position: absolute; + bottom: -.5rem; + left: 50%; + transform: translateX(-50%); +} + +.bd-header .bd-header__inner .navbar-header-items__end .navbar-item:not(:last-of-type) { + margin-right: 2rem; +} + +.bd-header .bd-header__inner .navbar-header-items__end svg { + height: 35%; + width: auto; +} + +.search-button__wrapper.show .search-button__overlay { + background: var(--flair-blue); +} + +.search-button__wrapper.show form.bd-search i { + display: none; +} + +.search-button__wrapper.show form.bd-search input { + border: 2px var(--flair-orange) solid; + color: var(--flair-blue); + box-shadow: none; + padding: .25em 5.5em .25em .75em; + border-radius: 1rem; + font-size: 1.2rem; +} + +.search-button__wrapper.show form.bd-search .search-button__kbd-shortcut { + align-items: center; +} + +.fill-white-blue { + fill: var(--white-blue); + stroke: none; +} + +.fill-orange { + fill: var(--flair-orange); + stroke: none; +} + +.stroke-moon { + stroke: white; + fill: none; +} + +button.search-button { + background-size: contain; + background-repeat: no-repeat; + background-position: center; + border-radius: 0; + height: 1.85rem; + width: 1.85rem; +} + +button.search-button i { + visibility: hidden; +} + +button.search-button i:focus, button.search-button i, button.search-button i:active { + border: none; + outline: none; +} + +.sidebar-toggle span { + color: white; + font-size: 2rem; + margin-right: 1rem; +} + +.dark-mode-toggle svg { + cursor: pointer; +} + +:root .dark-mode .dark-mode-toggle svg:first-of-type { + display: none; +} + +.dark-mode-toggle svg:nth-of-type(2) { + display: none; +} + +:root .dark-mode .dark-mode-toggle svg:nth-of-type(2) { + display: block; +} + +@media screen and (max-width: 1250px) { + .bd-header .bd-header__inner nav ul.bd-navbar-elements li.nav-item { + margin-left: 2rem; + } + + .bd-header .bd-header__inner .navbar-header-items__end .navbar-item:not(:last-of-type) { + margin-right: 1rem; + } +} + +@media screen and (max-width: 959px) { + .bd-sidebar-primary.bd-sidebar { + width: 100vw !important; + background: var(--flair-orange) !important; + height: calc(100vh - var(--header-height)); + max-width: initial !important; + display: block; + overflow-y: auto !important; + overflow-x: hidden !important; + } + + .bd-sidebar-primary.bd-sidebar .sidebar-header-items { + flex-direction: row; + max-width: 100%; + justify-content: space-between; + align-items: flex-start; + padding: 10vw 10vw 5vw 10vw !important; + } + + .bd-sidebar-primary.bd-sidebar .sidebar-header-items .sidebar-header-items__title, .bd-sidebar-primary.bd-sidebar .sidebar-header-items .nav-item .nav-link { + color: white; + } + + .bd-sidebar-primary.bd-sidebar .sidebar-primary-items__start { + padding: 5vw 10vw 10vw 10vw !important; + border-top: 2px solid white; + } + + .bd-sidebar-primary.bd-sidebar .sidebar-header-items__end { + gap: 0; + } + + .bd-sidebar-primary.bd-sidebar .current { + color: var(--flair-blue) !important; + } + + .bd-sidebar-primary.bd-sidebar a:hover { + color: var(--flair-blue) !important; + } + + .bd-sidebar-primary.bd-sidebar * { + color: white !important; + } +} \ No newline at end of file diff --git a/docs/_static/css/legal-notice.css b/docs/_static/css/legal-notice.css new file mode 100644 index 0000000000..7b65e532d4 --- /dev/null +++ b/docs/_static/css/legal-notice.css @@ -0,0 +1,4 @@ +.legal-notice strong { + font-size: 1.75rem; + font-weight: 600; +} \ No newline at end of file diff --git a/docs/_static/css/main.css b/docs/_static/css/main.css new file mode 100644 index 0000000000..2170090315 --- /dev/null +++ b/docs/_static/css/main.css @@ -0,0 +1,157 @@ +@import url("https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap"); + +:root { + --flair-orange: #f79910; + --flair-orange-light: #ffc063; + --flair-orange-transparent: rgba(247, 153, 16, 0.5); + --white-transparent: rgba(255, 255, 255, 0.5); + --flair-blue: #2f2e41; + --flair-dark-blue: #262635; + --light-gray: #e6e6e6; + --white-blue: white; + --blue-white: var(--flair-blue); + --orange-white: var(--flair-orange); + --orange-white-transparent: var(--flair-orange-transparent); + --orange-blue: var(--flair-orange); + --blue-orange: var(--flair-blue); + --gray-dark-blue: var(--light-gray); + --gray-white: var(--light-gray); + --error-red: #e32239; + --header-height: 90px; + --footer-height: 60px; + --track-color: #dddddd; + --track-thumb: #bbbbbb; + --track-thumb-hover: #999999; + font-family: "Afacad", sans-serif; + font-optical-sizing: auto; + font-weight: 400; + font-size: 21px; + font-style: normal; +} + +:root .dark-mode { + --white-blue: var(--flair-blue); + --blue-white: white; + --orange-white: white; + --orange-blue: var(--flair-blue); + --blue-orange: var(--flair-orange); + --orange-white-transparent: var(--white-transparent); + --gray-dark-blue: var(--flair-dark-blue); + --gray-white: white; + --track-color: #38374a; + --track-thumb: #4c4b5c; + --track-thumb-hover: #5c5b69; +} + +.fill-white-blue { + fill: var(--white-blue); + stroke: none; +} + +.fill-orange { + fill: var(--flair-orange); + stroke: none; +} + +.stroke-orange-white { + stroke: var(--orange-white); + fill: none; +} + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; + line-height: 1.2em; +} + +button { + font-family: inherit; +} + +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} + +body { + line-height: 1; + background-color: var(--white-blue); +} + +main { + min-height: calc(100vh - var(--header-height) - var(--footer-height)); +} + +ol, ul { + list-style: none; +} + +blockquote, q { + quotes: none; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +a { + color: var(--flair-orange); + text-decoration: none; + transition: color 200ms cubic-bezier(0, 0.35, 0.08, 0.89); +} + +a:visited { + color: var(--flair-orange); +} + +a:hover { + color: var(--flair-orange-light); + text-decoration: none; +} + +::selection { + background: var(--flair-orange); + color: var(--white-blue); +} + +.inv-sel::selection { + background: var(--white-blue); + color: var(--flair-orange); +} + +.bd-container__inner { + max-width: 100%; +} + +body::-webkit-scrollbar, ::-webkit-scrollbar { + width: 10px; +} + +body::-webkit-scrollbar-track, ::-webkit-scrollbar-track { + background: var(--track-color); +} + +body::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb { + background: var(--track-thumb); + border-radius: 0; +} + +body::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:hover { + background: var(--track-thumb-hover); +} \ No newline at end of file diff --git a/docs/_static/css/search.css b/docs/_static/css/search.css new file mode 100644 index 0000000000..addc16ffea --- /dev/null +++ b/docs/_static/css/search.css @@ -0,0 +1,78 @@ +.bd-search-container h1 { + color: var(--blue-white); + font-size: 3rem; + font-weight: 600; +} + +.bd-search-container h2 { + color: var(--blue-white); + font-weight: 600; + font-size: 1.5rem; +} + +.bd-search-container form.bd-search i { + display: none; +} + +.bd-search-container form.bd-search input { + border: 2px var(--flair-orange) solid; + color: var(--flair-blue); + box-shadow: none; + padding: .25em 5.5em .25em .75em; + border-radius: 1rem; + font-size: 1.2rem; +} + +.bd-search-container form.bd-search .search-button__kbd-shortcut { + align-items: center; +} + +.bd-search-container p.search-summary { + color: var(--blue-white) !important; +} + +.bd-search-container ul.search li { + border-top: 2px solid var(--blue-white); + margin: 0 0 .05em 0; +} + +.bd-search-container ul.search li:first-of-type { + margin-top: 1rem; + border: none; +} + +.bd-search-container ul.search li a { + font-weight: 400; +} + +.bd-search-container ul.search li span { + color: var(--blue-white); +} + +.highlighted { + background: var(--flair-orange) !important; + color: white !important; + border-radius: 5px !important; +} + +div#searchbox p.highlight-link { + box-shadow: none !important; + margin: 1rem 0; +} + +div#searchbox p.highlight-link a { + background: var(--white-blue) !important; + border: 2px var(--flair-orange) solid; + color: var(--flair-orange); + transition: all 200ms ease-in-out; +} + +div#searchbox p.highlight-link a:hover { + background: var(--flair-orange) !important; + color: white !important; + box-shadow: none !important; +} + +div#searchbox p.highlight-link a::before { + content: none; +} \ No newline at end of file diff --git a/docs/_static/css/sidebar.css b/docs/_static/css/sidebar.css new file mode 100644 index 0000000000..7d67c22041 --- /dev/null +++ b/docs/_static/css/sidebar.css @@ -0,0 +1,87 @@ +.bd-sidebar-primary.bd-sidebar { + top: 90px; + width: 350px; + padding: 0; + border: none; + overflow: initial; + background: var(--white-blue); +} + +.bd-sidebar-primary.bd-sidebar #rtd-footer-container, .bd-sidebar-primary.bd-sidebar .sidebar-primary-items__end { + display: none; +} + +.bd-sidebar-primary.bd-sidebar::after { + content: ""; + background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, transparent 100%); + height: 100%; + width: 7px; + position: absolute; + right: 0; + transform: translateX(100%); + top: 0; +} + +.bd-sidebar-primary.bd-sidebar h3 { + display: none; +} + +.bd-sidebar-primary.bd-sidebar * { + color: var(--blue-white); +} + +.bd-sidebar-primary.bd-sidebar a:hover { + color: var(--flair-orange); +} + +.bd-sidebar-primary.bd-sidebar a:hover * { + color: var(--flair-orange); +} + +.bd-sidebar-primary.bd-sidebar a * { + transition: color 200ms cubic-bezier(0, 0.35, 0.08, 0.89); +} + +.bd-sidebar-primary.bd-sidebar .sidebar-primary-items__start { + overflow-y: auto; + padding: 2rem; +} + +.bd-sidebar-primary.bd-sidebar .sidebar-primary-item { + padding: 0; +} + +.bd-sidebar-primary.bd-sidebar .toctree-l1 { + font-size: 1.5rem; + font-weight: 600; + margin-top: .8rem; +} + +.bd-sidebar-primary.bd-sidebar .toctree-l2 { + font-size: 1rem; + font-weight: 400; + margin-top: .8rem; +} + +.bd-sidebar-primary.bd-sidebar .toctree-l2 ul { + margin-left: 1rem; +} + +.bd-sidebar-primary.bd-sidebar .toctree-l3 { + margin-top: .8rem; +} + +.bd-sidebar-primary.bd-sidebar .toctree-l4 { + margin-top: .8rem; +} + +.bd-sidebar-primary.bd-sidebar .current, .bd-sidebar-primary.bd-sidebar .current * { + color: var(--flair-orange); +} + +.bd-sidebar-primary.bd-sidebar code { + padding: 0; + background: transparent; + border: none; + font-weight: 400; +} \ No newline at end of file diff --git a/docs/_static/css/tutorial.css b/docs/_static/css/tutorial.css new file mode 100644 index 0000000000..9139e8984f --- /dev/null +++ b/docs/_static/css/tutorial.css @@ -0,0 +1,421 @@ +@charset "UTF-8"; + +.bd-main .bd-content .bd-article-container { + max-width: initial; + padding: 4rem 30% 4rem 5rem; + box-sizing: border-box; +} + +.bd-main .bd-content .bd-article-container .bd-article { + padding: 0; +} + +.bd-main .bd-content .bd-article-container .bd-article *:not(pre) { + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.bd-main .bd-content .bd-article-container .bd-article .headerlink { + display: none; +} + +.bd-main .bd-content .bd-article-container .bd-article h1 { + font-size: 3rem; + color: var(--blue-white); + font-weight: 600; + margin-top: 0.5em; + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.bd-main .bd-content .bd-article-container .bd-article h2 { + font-size: 1.6rem; + color: var(--blue-white); + font-weight: 600; + margin-top: 2em; + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.bd-main .bd-content .bd-article-container .bd-article h3 { + font-size: 1.2rem; + color: var(--blue-white); + font-weight: 600; + margin-top: 2em; + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +.bd-main .bd-content .bd-article-container .bd-article p { + color: var(--blue-white); + margin: 0.4em 0 0.9em 0; +} + +.bd-main .bd-content .bd-article-container .bd-article ul { + list-style-type: "»"; + margin-left: .6em; +} + +.bd-main .bd-content .bd-article-container .bd-article ul li { + padding-left: .3em; +} + +.bd-main .bd-content .bd-article-container .bd-article ul ::marker { + color: var(--blue-white); + font-size: inherit; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight { + background: transparent; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre { + font-family: "Source Code Pro", monospace; + padding: 1.1em 1.5em; + border-radius: 1rem; + background: var(--gray-dark-blue); +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .nn, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .n, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .o, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .p, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .kp { + color: var(--blue-white); +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .kn, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .k, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .ow, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .kc { + color: #CF8E6D; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .nb { + color: #8888C6; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .nf { + color: #56A8F5; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .c1 { + color: #7A7E85; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .s1, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .s2, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .sa, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .si { + color: #6AAB73; +} + +.bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .mi, .bd-main .bd-content .bd-article-container .bd-article .highlight-python .highlight pre .mf { + color: #2AACB8; +} + +.bd-main .bd-content .bd-article-container .bd-article [class^="highlight-"]:not(.highlight-python) * { + color: var(--blue-white); +} + +.bd-main .bd-content .bd-article-container .bd-article [class^="highlight-"]:not(.highlight-python) .highlight { + background: transparent; +} + +.bd-main .bd-content .bd-article-container .bd-article [class^="highlight-"]:not(.highlight-python) pre { + font-family: "Source Code Pro", monospace; + border-radius: 1rem; + padding: 1.1em 1.5em; + background: var(--gray-dark-blue); + color: var(--blue-white); +} + +.bd-main .bd-content .bd-article-container .bd-article [class^="highlight-"]:not(.highlight-python) pre .go { + font-size: inherit; + padding-right: 1.1em; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition, .bd-main .bd-content .bd-article-container .bd-article div.admonition, .bd-main .bd-content .bd-article-container .bd-article .admonition.note, .bd-main .bd-content .bd-article-container .bd-article div.admonition.note { + box-shadow: none !important; + background: linear-gradient(180deg, var(--flair-orange) 0, var(--flair-orange) 2rem, var(--white-blue) 2rem, var(--white-blue) 100%); + border: 2px var(--flair-orange) solid; + border-radius: 1rem; + padding: 0; + box-sizing: border-box; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition p.admonition-title, .bd-main .bd-content .bd-article-container .bd-article div.admonition p.admonition-title, .bd-main .bd-content .bd-article-container .bd-article .admonition.note p.admonition-title, .bd-main .bd-content .bd-article-container .bd-article div.admonition.note p.admonition-title { + background: var(--flair-orange); + border-radius: 0 0 1rem 1rem; + margin: 0; + font-size: 1.5rem; + font-weight: 400; + padding: 0.5em 2.2em; + position: relative; + line-height: 1em; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition p.admonition-title::before, .bd-main .bd-content .bd-article-container .bd-article div.admonition p.admonition-title::before, .bd-main .bd-content .bd-article-container .bd-article .admonition.note p.admonition-title::before, .bd-main .bd-content .bd-article-container .bd-article div.admonition.note p.admonition-title::before { + content: none; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition p.admonition-title::after, .bd-main .bd-content .bd-article-container .bd-article div.admonition p.admonition-title::after, .bd-main .bd-content .bd-article-container .bd-article .admonition.note p.admonition-title::after, .bd-main .bd-content .bd-article-container .bd-article div.admonition.note p.admonition-title::after { + color: white; + margin-left: 0.4em; + font-size: 0.9em; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition p:not(.admonition-title), .bd-main .bd-content .bd-article-container .bd-article div.admonition p:not(.admonition-title), .bd-main .bd-content .bd-article-container .bd-article .admonition.note p:not(.admonition-title), .bd-main .bd-content .bd-article-container .bd-article div.admonition.note p:not(.admonition-title) { + padding: 0.5em 2.2em 0.25em 3.3em; +} + +.bd-main .bd-content .bd-article-container .bd-article .admonition [class^="highlight-"], .bd-main .bd-content .bd-article-container .bd-article div.admonition [class^="highlight-"], .bd-main .bd-content .bd-article-container .bd-article .admonition.note [class^="highlight-"], .bd-main .bd-content .bd-article-container .bd-article div.admonition.note [class^="highlight-"] { + margin-bottom: 0.7rem; +} + +.header-article-items.header-article__inner { + padding: 0; +} + +ul.bd-breadcrumbs { + word-break: break-word; + overflow-wrap: break-word; + white-space: normal; +} + +ul.bd-breadcrumbs li.breadcrumb-home .fa-home::before { + content: "Home"; + font-family: "Afacad", sans-serif; + font-size: 1rem; + font-weight: 400; + color: var(--blue-white); + transition: color 200ms ease-in-out; +} + +ul.bd-breadcrumbs li.breadcrumb-home a:hover .fa-home::before { + color: var(--flair-orange); +} + +ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home)::before { + content: ""; + width: 1px; + height: 1rem; + background: var(--blue-white); + display: inline-block; + padding: 0; + transform: rotate(30deg); + margin: 0 .6rem; +} + +ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home) a { + color: var(--blue-white); + font-size: 1rem; + font-weight: 400; +} +ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home) i { + color: var(--blue-white); +} + + +ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home) a:hover { + color: var(--flair-orange); +} + +ul.bd-breadcrumbs li.breadcrumb-item:not(.breadcrumb-home).active { + color: var(--blue-white); + font-size: 1rem; + font-weight: 400; +} + +table.table { + border-collapse: collapse; + border-radius: 1rem; + box-shadow: 0 0 0 2px var(--blue-white); +} + +table.table tr:not(:last-of-type), table.table tr:has(th) { + border-bottom: 2px var(--blue-white) solid; +} + +table.table tr th { + font-weight: 600; +} + +table.table tr th, table.table tr td { + padding: .4em .2em 0 .2em; +} + +table.table tr th:first-of-type, table.table tr td:first-of-type { + padding-left: .5em; +} + +table.table tr th:last-of-type, table.table tr td:last-of-type { + padding-right: .5em; +} + +.docutils, .docutils.literal { + border: none; + background: transparent; + border-radius: 0.5em; + font-weight: 400; + font-family: "Source Code Pro", monospace; + font-size: 0.8em; + color: var(--blue-white); + position: relative; + z-index: 1; + display: inline-block; +} + +.docutils::before, .docutils.literal::before { + content: ""; + width: 100%; + height: 90%; + top: 50%; + left: 0; + transform: translateY(-50%); + border-radius: 0.5em; + border: 2px var(--blue-white) solid; + position: absolute; +} + +.reference .docutils, .reference .docutils.literal { + transition: color 200ms ease-in-out; +} + +.reference .docutils:hover, .reference .docutils.literal:hover { + color: white; +} + +.reference .docutils:hover::before, .reference .docutils.literal:hover::before { + background: var(--flair-orange); +} + +.reference .docutils::before, .reference .docutils.literal::before { + z-index: -1; + border-color: var(--flair-orange); + transition: background-color 200ms ease-in-out; +} + +#flair-tutorials li, #api-docs li, #contributing li, [id^="tutorial"] li, [id^="flair"] li { + list-style-type: "»" !important; + padding-left: 0.25em; + margin-top: .5em; +} + +#flair-tutorials li ::marker, #api-docs li ::marker, #contributing li ::marker, [id^="tutorial"] li ::marker, [id^="flair"] li ::marker { + color: var(--blue-white); + font-size: 1.2rem; +} + +#flair-tutorials .toctree-wrapper li[class^="toctree-l"], #api-docs .toctree-wrapper li[class^="toctree-l"], #contributing .toctree-wrapper li[class^="toctree-l"], [id^="tutorial"] .toctree-wrapper li[class^="toctree-l"], [id^="flair"] .toctree-wrapper li[class^="toctree-l"] { + margin-top: .5em; +} + +#flair-tutorials .toctree-wrapper li[class^="toctree-l"]::marker, #api-docs .toctree-wrapper li[class^="toctree-l"]::marker, #contributing .toctree-wrapper li[class^="toctree-l"]::marker, [id^="tutorial"] .toctree-wrapper li[class^="toctree-l"]::marker, [id^="flair"] .toctree-wrapper li[class^="toctree-l"]::marker { + font-size: 1.2rem !important; +} + +#flair-tutorials .toctree-wrapper li[class^="toctree-l"] > a, #api-docs .toctree-wrapper li[class^="toctree-l"] > a, #contributing .toctree-wrapper li[class^="toctree-l"] > a, [id^="tutorial"] .toctree-wrapper li[class^="toctree-l"] > a, [id^="flair"] .toctree-wrapper li[class^="toctree-l"] > a { + font-size: 1.2rem; +} + +#flair-tutorials .docutils:not(.py), #api-docs .docutils:not(.py), #contributing .docutils:not(.py), [id^="tutorial"] .docutils:not(.py), [id^="flair"] .docutils:not(.py) { + color: var(--flair-orange); +} + +#flair-tutorials .docutils:not(.py):hover, #api-docs .docutils:not(.py):hover, #contributing .docutils:not(.py):hover, [id^="tutorial"] .docutils:not(.py):hover, [id^="flair"] .docutils:not(.py):hover { + color: var(--flair-orange-light); +} + +#flair-tutorials .docutils:not(.py)::before, #api-docs .docutils:not(.py)::before, #contributing .docutils:not(.py)::before, [id^="tutorial"] .docutils:not(.py)::before, [id^="flair"] .docutils:not(.py)::before { + content: none; +} + +#flair-tutorials .docutils:not(.py) .pre, #api-docs .docutils:not(.py) .pre, #contributing .docutils:not(.py) .pre, [id^="tutorial"] .docutils:not(.py) .pre, [id^="flair"] .docutils:not(.py) .pre { + font-family: "Afacad", sans-serif; + text-overflow: ellipsis; + font-size: 1.2rem; +} + +@media screen and (max-width: 700px) { + .bd-article-container { + padding: 3rem !important; + } + + .admonition p, div.admonition p, .admonition.note p, div.admonition.note p { + padding-left: 1rem !important; + } + + .admonition p.admonition-title, div.admonition p.admonition-title, .admonition.note p.admonition-title, div.admonition.note p.admonition-title { + padding-left: 1rem !important; + } + + .admonition p.admonition-title::after, div.admonition p.admonition-title::after, .admonition.note p.admonition-title::after, div.admonition.note p.admonition-title::after { + position: relative; + left: -0.1rem; + } + + .deprecated { + padding-left: 1rem !important; + } + + .deprecated .deprecated { + padding-left: 0 !important; + } + + .deprecated::before { + position: relative !important; + } +} + +@media screen and (max-width: 500px) { + #flair-tutorials .toctree-wrapper li[class^="toctree-l"] > a, #flair-tutorials .toctree-wrapper li[class^="toctree-l"] > a span, #api-docs .toctree-wrapper li[class^="toctree-l"] > a, #api-docs .toctree-wrapper li[class^="toctree-l"] > a span, #contributing .toctree-wrapper li[class^="toctree-l"] > a, #contributing .toctree-wrapper li[class^="toctree-l"] > a span, [id^="tutorial"] .toctree-wrapper li[class^="toctree-l"] > a, [id^="tutorial"] .toctree-wrapper li[class^="toctree-l"] > a span, [id^="flair"] .toctree-wrapper li[class^="toctree-l"] > a, [id^="flair"] .toctree-wrapper li[class^="toctree-l"] > a span { + font-size: 1rem !important; + } + + .toctree-wrapper li[class^="toctree-l"] > ul { + padding-inline-start: 0; + } + + .bd-article-container { + padding: 2rem !important; + } +} + +@media screen and (max-width: 1200px) { + .bd-main .bd-content .bd-article-container .bd-article h1 { + font-size: 2rem; + } + + .bd-main .bd-content .bd-article-container .bd-article h2 { + font-size: 1.2rem; + } + + .bd-main .bd-content .bd-article-container .bd-article h3 { + font-size: 1rem; + } + + .bd-article-container { + padding: 4rem; + } +} + +@media screen and (max-width: 900px) { + .bd-main .bd-content .bd-article-container .bd-article h1 { + font-size: 1.6rem; + } + + .bd-main .bd-content .bd-article-container .bd-article h2 { + font-size: 1rem; + } + + .bd-main .bd-content .bd-article-container .bd-article h3 { + font-size: 1rem; + } + + .bd-article-container { + padding: 4rem; + } + + .bd-header-article { + margin-bottom: 3rem; + } + + pre, pre * { + font-size: 0.8rem; + } +} \ No newline at end of file diff --git a/docs/_static/css/version-switcher.css b/docs/_static/css/version-switcher.css new file mode 100644 index 0000000000..5b54fb6270 --- /dev/null +++ b/docs/_static/css/version-switcher.css @@ -0,0 +1,78 @@ +.version-switcher__container { + position: relative; + z-index: 10; +} + +.version-switcher__container #versionswitcherbutton { + background: var(--flair-orange); + border: 2px white solid; + color: white; + font-weight: 500; + cursor: pointer; + font-size: 1rem; + padding: 0.2em 1em; + border-radius: 0.66em; + font-family: inherit; + width: 7em; +} + +.version-switcher__container #versionswitcherbutton::after { + content: none; +} + +.version-switcher__container #versionswitcherlist { + background: var(--flair-orange); + position: absolute; + top: calc(100% + 0.4rem); + left: 0; + display: none; + flex-direction: column; + border: 2px white solid; + border-radius: 0.66em; + font-size: 1rem; + min-width: 100%; + box-sizing: border-box; + overflow: hidden; +} + +.version-switcher__container.open #versionswitcherlist { + display: flex; +} + +.version-switcher__container .version-switcher__menu a.list-group-item:not(:last-child) { + border-bottom: none; +} + +.version-switcher__container a.list-group-item { + background: var(--flair-orange); + font-size: 1rem; + padding: 0.2em 1em 0.2em 1em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + position: relative; + transition: all 200ms cubic-bezier(0, 0.35, 0.08, 0.89); +} + +.version-switcher__container a.list-group-item:hover { + background: var(--white-transparent); + color: var(--white-blue); +} + +.version-switcher__container a.list-group-item span { + color: white; +} + +.version-switcher__container a.list-group-item:not(:last-of-type) { + padding-bottom: calc(0.2em + 2px); +} + +.version-switcher__container a.list-group-item:not(:last-of-type)::after { + content: ""; + height: 2px; + width: 100%; + background: white; + position: absolute; + bottom: 0; + left: 0; +} \ No newline at end of file diff --git a/docs/_static/flair_logo_orange.svg b/docs/_static/flair_logo_orange.svg new file mode 100755 index 0000000000..e37b4f5a45 --- /dev/null +++ b/docs/_static/flair_logo_orange.svg @@ -0,0 +1,101 @@ + + + + diff --git a/docs/_static/flair_logo_white.svg b/docs/_static/flair_logo_white.svg new file mode 100755 index 0000000000..aad189d1b8 --- /dev/null +++ b/docs/_static/flair_logo_white.svg @@ -0,0 +1,101 @@ + + + + diff --git a/docs/_static/magnifying_glass.svg b/docs/_static/magnifying_glass.svg new file mode 100644 index 0000000000..3048ce30c6 --- /dev/null +++ b/docs/_static/magnifying_glass.svg @@ -0,0 +1,56 @@ + + + + + + + + + diff --git a/docs/_static/magnifying_glass_dark.svg b/docs/_static/magnifying_glass_dark.svg new file mode 100644 index 0000000000..5350d0e540 --- /dev/null +++ b/docs/_static/magnifying_glass_dark.svg @@ -0,0 +1,56 @@ + + + + + + + + + diff --git a/docs/_static/octocat.svg b/docs/_static/octocat.svg new file mode 100644 index 0000000000..ce2cf1d99d --- /dev/null +++ b/docs/_static/octocat.svg @@ -0,0 +1,41 @@ + + + + + + diff --git a/docs/_templates/darkmode-toggle.html b/docs/_templates/darkmode-toggle.html new file mode 100644 index 0000000000..f7e0658f94 --- /dev/null +++ b/docs/_templates/darkmode-toggle.html @@ -0,0 +1,152 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/docs/_templates/footer-links/legal-notice.html b/docs/_templates/footer-links/legal-notice.html new file mode 100644 index 0000000000..ab3b0dd4ac --- /dev/null +++ b/docs/_templates/footer-links/legal-notice.html @@ -0,0 +1 @@ +Legal notice \ No newline at end of file diff --git a/docs/_templates/footer-links/linkedin.html b/docs/_templates/footer-links/linkedin.html new file mode 100644 index 0000000000..f6f83d745d --- /dev/null +++ b/docs/_templates/footer-links/linkedin.html @@ -0,0 +1 @@ +LinkedIn \ No newline at end of file diff --git a/docs/_templates/footer-links/x.html b/docs/_templates/footer-links/x.html new file mode 100644 index 0000000000..c9976cdddf --- /dev/null +++ b/docs/_templates/footer-links/x.html @@ -0,0 +1 @@ +Twitter/X \ No newline at end of file diff --git a/docs/_templates/landing-page-banner.html b/docs/_templates/landing-page-banner.html new file mode 100644 index 0000000000..8130a83d52 --- /dev/null +++ b/docs/_templates/landing-page-banner.html @@ -0,0 +1,353 @@ +
+ +
\ No newline at end of file diff --git a/docs/_templates/landing-page-illustrations.html b/docs/_templates/landing-page-illustrations.html new file mode 100644 index 0000000000..b6b55230a5 --- /dev/null +++ b/docs/_templates/landing-page-illustrations.html @@ -0,0 +1,30 @@ +
+
+ + + Easy to Use +

+ State-of-the-art NLP with just a few lines of code! Find entities, detect sentiment, and more. + Check out our demo! +

+
+
+ + + Huge Community +

+ With a community of ~200 contributors, Flair is used in hundreds of companies, + over 2,000 open source projects, and + 2,000+ papers! +

+
+
+ + + Open Source and Free +

+ Flair is completely free and open source, making it accessible for everyone to use + and report issues. +

+
+
\ No newline at end of file diff --git a/docs/_templates/landing_page_styles.html b/docs/_templates/landing_page_styles.html new file mode 100644 index 0000000000..d98569463a --- /dev/null +++ b/docs/_templates/landing_page_styles.html @@ -0,0 +1,339 @@ + diff --git a/docs/_templates/legal-notice-content.html b/docs/_templates/legal-notice-content.html new file mode 100644 index 0000000000..15a5a0ac8a --- /dev/null +++ b/docs/_templates/legal-notice-content.html @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/docs/_templates/version-switcher.html b/docs/_templates/version-switcher.html index 1d21c6c65f..ad1676b4d8 100644 --- a/docs/_templates/version-switcher.html +++ b/docs/_templates/version-switcher.html @@ -1,30 +1,45 @@ {# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript. #} + diff --git a/docs/api/datasets/base.rst b/docs/api/datasets/base.rst index e42784deb0..80c375eec8 100644 --- a/docs/api/datasets/base.rst +++ b/docs/api/datasets/base.rst @@ -1,4 +1,8 @@ flair.datasets.base =================== -.. automodule:: flair.datasets.base \ No newline at end of file +.. currentmodule:: flair.datasets.base + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/biomedical.rst b/docs/api/datasets/biomedical.rst index d59bd8c589..c1d2525ece 100644 --- a/docs/api/datasets/biomedical.rst +++ b/docs/api/datasets/biomedical.rst @@ -1,4 +1,8 @@ flair.datasets.biomedical ========================= -.. automodule:: flair.datasets.biomedical \ No newline at end of file +.. currentmodule:: flair.datasets.biomedical + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/document_classification.rst b/docs/api/datasets/document_classification.rst index d8303f3aeb..0de14b6cdd 100644 --- a/docs/api/datasets/document_classification.rst +++ b/docs/api/datasets/document_classification.rst @@ -1,4 +1,8 @@ flair.datasets.document_classification ====================================== -.. automodule:: flair.datasets.document_classification \ No newline at end of file +.. currentmodule:: flair.datasets.document_classification + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/entity_linking.rst b/docs/api/datasets/entity_linking.rst index cdb2b32356..a88308e97d 100644 --- a/docs/api/datasets/entity_linking.rst +++ b/docs/api/datasets/entity_linking.rst @@ -1,4 +1,8 @@ flair.datasets.entity_linking ============================= -.. automodule:: flair.datasets.entity_linking \ No newline at end of file +.. currentmodule:: flair.datasets.entity_linking + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/ocr.rst b/docs/api/datasets/ocr.rst index 3f85340440..f5629a5631 100644 --- a/docs/api/datasets/ocr.rst +++ b/docs/api/datasets/ocr.rst @@ -1,4 +1,8 @@ flair.datasets.ocr ================== -.. automodule:: flair.datasets.ocr \ No newline at end of file +.. currentmodule:: flair.datasets.ocr + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/relation_extraction.rst b/docs/api/datasets/relation_extraction.rst index 62dcdd55d1..fdbb690cfe 100644 --- a/docs/api/datasets/relation_extraction.rst +++ b/docs/api/datasets/relation_extraction.rst @@ -1,4 +1,8 @@ flair.datasets.relation_extraction ================================== -.. automodule:: flair.datasets.relation_extraction \ No newline at end of file +.. currentmodule:: flair.datasets.relation_extraction + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/sequence_labeling.rst b/docs/api/datasets/sequence_labeling.rst index 875d4831b1..0c0abc520d 100644 --- a/docs/api/datasets/sequence_labeling.rst +++ b/docs/api/datasets/sequence_labeling.rst @@ -1,4 +1,8 @@ flair.datasets.sequence_labeling ================================ -.. automodule:: flair.datasets.sequence_labeling \ No newline at end of file +.. currentmodule:: flair.datasets.sequence_labeling + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/text_image.rst b/docs/api/datasets/text_image.rst index f14e564916..173928dfc1 100644 --- a/docs/api/datasets/text_image.rst +++ b/docs/api/datasets/text_image.rst @@ -1,4 +1,8 @@ flair.datasets.text_image ========================= -.. automodule:: flair.datasets.text_image \ No newline at end of file +.. currentmodule:: flair.datasets.text_image + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/datasets/text_text.rst b/docs/api/datasets/text_text.rst index f88dfd1aed..79a60ae609 100644 --- a/docs/api/datasets/text_text.rst +++ b/docs/api/datasets/text_text.rst @@ -1,4 +1,10 @@ flair.datasets.text_text -========================= +======================== + +.. currentmodule:: flair.datasets.text_text + +.. autosummary:: + :toctree: generated + :nosignatures: + -.. automodule:: flair.datasets.text_text \ No newline at end of file diff --git a/docs/api/datasets/treebanks.rst b/docs/api/datasets/treebanks.rst index 0d6c14a281..82cba954f7 100644 --- a/docs/api/datasets/treebanks.rst +++ b/docs/api/datasets/treebanks.rst @@ -1,4 +1,8 @@ flair.datasets.treebanks ======================== -.. automodule:: flair.datasets.treebanks \ No newline at end of file +.. currentmodule:: flair.datasets.treebanks + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/base.rst b/docs/api/embeddings/base.rst index 1bf51ffa7a..02a65a20b9 100644 --- a/docs/api/embeddings/base.rst +++ b/docs/api/embeddings/base.rst @@ -1,4 +1,8 @@ flair.embeddings.base ===================== -.. automodule:: flair.embeddings.base \ No newline at end of file +.. currentmodule:: flair.embeddings.base + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/document.rst b/docs/api/embeddings/document.rst index ca870fc8ea..8c5aea548d 100644 --- a/docs/api/embeddings/document.rst +++ b/docs/api/embeddings/document.rst @@ -1,4 +1,8 @@ flair.embeddings.document ========================= -.. automodule:: flair.embeddings.document \ No newline at end of file +.. currentmodule:: flair.embeddings.document + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/image.rst b/docs/api/embeddings/image.rst index 2a701b9e0b..6a115e705c 100644 --- a/docs/api/embeddings/image.rst +++ b/docs/api/embeddings/image.rst @@ -1,4 +1,8 @@ flair.embeddings.image ====================== -.. automodule:: flair.embeddings.image \ No newline at end of file +.. currentmodule:: flair.embeddings.image + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/legacy.rst b/docs/api/embeddings/legacy.rst index 974a777eb9..a177a1ffc2 100644 --- a/docs/api/embeddings/legacy.rst +++ b/docs/api/embeddings/legacy.rst @@ -1,8 +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. +.. currentmodule:: flair.embeddings.legacy -.. automodule:: flair.embeddings.legacy \ No newline at end of file +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/token.rst b/docs/api/embeddings/token.rst index 3705fedb1d..7fc6305bdb 100644 --- a/docs/api/embeddings/token.rst +++ b/docs/api/embeddings/token.rst @@ -1,4 +1,8 @@ flair.embeddings.token ====================== -.. automodule:: flair.embeddings.token \ No newline at end of file +.. currentmodule:: flair.embeddings.token + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/embeddings/transformer.rst b/docs/api/embeddings/transformer.rst index 2bda02f771..51e04a43c9 100644 --- a/docs/api/embeddings/transformer.rst +++ b/docs/api/embeddings/transformer.rst @@ -1,4 +1,8 @@ flair.embeddings.transformer ============================ -.. automodule:: flair.embeddings.transformer \ No newline at end of file +.. currentmodule:: flair.embeddings.transformer + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.data.rst b/docs/api/flair.data.rst index 00dd67a521..dae99e093b 100644 --- a/docs/api/flair.data.rst +++ b/docs/api/flair.data.rst @@ -1,4 +1,8 @@ flair.data ========== -.. automodule:: flair.data \ No newline at end of file +.. currentmodule:: flair.data + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.datasets.rst b/docs/api/flair.datasets.rst index 9a883c3e61..d822186e67 100644 --- a/docs/api/flair.datasets.rst +++ b/docs/api/flair.datasets.rst @@ -1,6 +1,8 @@ flair.datasets ============== +.. currentmodule:: flair.datasets + .. toctree:: :glob: :maxdepth: 2 diff --git a/docs/api/flair.embeddings.rst b/docs/api/flair.embeddings.rst index 3f70e62bef..82905def03 100644 --- a/docs/api/flair.embeddings.rst +++ b/docs/api/flair.embeddings.rst @@ -1,6 +1,8 @@ flair.embeddings ================ +.. currentmodule:: flair.embeddings + .. toctree:: :glob: :maxdepth: 2 diff --git a/docs/api/flair.models.rst b/docs/api/flair.models.rst index 8679b3fb7d..0451fb30bd 100644 --- a/docs/api/flair.models.rst +++ b/docs/api/flair.models.rst @@ -1,4 +1,8 @@ flair.models ============ -.. automodule:: flair.models \ No newline at end of file +.. currentmodule:: flair.models + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.nn.rst b/docs/api/flair.nn.rst index 4eb066d3ea..6a7247256a 100644 --- a/docs/api/flair.nn.rst +++ b/docs/api/flair.nn.rst @@ -1,4 +1,8 @@ flair.nn ======== -.. automodule:: flair.nn \ No newline at end of file +.. currentmodule:: flair.nn + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.rst b/docs/api/flair.rst index 4e12a03829..946c68a6a4 100644 --- a/docs/api/flair.rst +++ b/docs/api/flair.rst @@ -1,4 +1,8 @@ flair ===== -.. automodule:: flair \ No newline at end of file +.. currentmodule:: flair + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.splitter.rst b/docs/api/flair.splitter.rst index 5863df5788..f9b71de316 100644 --- a/docs/api/flair.splitter.rst +++ b/docs/api/flair.splitter.rst @@ -1,4 +1,9 @@ flair.splitter ============== -.. automodule:: flair.splitter \ No newline at end of file +.. currentmodule:: flair.splitter + +.. autosummary:: + :toctree: generated + :nosignatures: + diff --git a/docs/api/flair.tokenization.rst b/docs/api/flair.tokenization.rst index 00f2bc4bfd..ec5ca557d1 100644 --- a/docs/api/flair.tokenization.rst +++ b/docs/api/flair.tokenization.rst @@ -1,4 +1,8 @@ flair.tokenization ================== -.. automodule:: flair.tokenization \ No newline at end of file +.. currentmodule:: flair.tokenization + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.trainers.plugins.rst b/docs/api/flair.trainers.plugins.rst index 4bb766876b..acd8109cf4 100644 --- a/docs/api/flair.trainers.plugins.rst +++ b/docs/api/flair.trainers.plugins.rst @@ -1,4 +1,8 @@ flair.trainers.plugins ====================== -.. automodule:: flair.trainers.plugins \ No newline at end of file +.. currentmodule:: flair.trainers.plugins + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/api/flair.trainers.rst b/docs/api/flair.trainers.rst index db11b5029c..ac59a85039 100644 --- a/docs/api/flair.trainers.rst +++ b/docs/api/flair.trainers.rst @@ -1,4 +1,8 @@ flair.trainers ============== -.. automodule:: flair.trainers \ No newline at end of file +.. currentmodule:: flair.trainers + +.. autosummary:: + :toctree: generated + :nosignatures: diff --git a/docs/conf.py b/docs/conf.py index 64624043e0..c1be9c0079 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,5 @@ # noqa: INP001 +import inspect import importlib_metadata @@ -27,21 +28,18 @@ } # dummy value that sphinx-github-style won't crash when run in temp folder. html_theme_options = { - "navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"], - "github_url": linkcode_url, - "icon_links": [ - { - "name": "PyPI", - "url": "https://pypi.org/project/flair", - "icon": "fas fa-box", - }, - ], + "navbar_end": ["darkmode-toggle", "version-switcher", "navbar-icon-links"], + "show_prev_next": False, + "footer_end": ["footer-links/legal-notice.html", "footer-links/x.html", "footer-links/linkedin.html"], + "secondary_sidebar_items": [] } def linkcode_resolve(*args): + app = inspect.currentframe().f_back.f_locals.get("app") + current_version = app.config.smv_current_version # use smv_current_version as the git url - real_linkcode_url = linkcode_url + f"/blob/{smv_current_version}/" + "{filepath}#L{linestart}-L{linestop}" + real_linkcode_url = linkcode_url + f"/blob/{current_version}/" + "{filepath}#L{linestart}-L{linestop}" return get_linkcode_resolve(real_linkcode_url)(*args) @@ -56,13 +54,15 @@ def linkcode_resolve(*args): "sphinx.ext.ifconfig", "sphinx.ext.napoleon", # to render Google format docstrings "sphinx.ext.githubpages", + "sphinx_autosummary_autocollect", "myst_parser", "sphinx_github_style", "sphinx_autodoc_typehints", "sphinx_multiversion", "sphinx_design", ] - +autosummary_generate = True +autosummary_ignore_module_all = False # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -82,6 +82,22 @@ def linkcode_resolve(*args): # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] +html_title = 'Flair Documentation' + +html_css_files = [ + 'css/main.css', + 'css/header.css', + 'css/footer.css', + 'css/version-switcher.css', + 'css/sidebar.css', + 'css/tutorial.css', + 'css/api.css', + 'css/legal-notice.css', + 'css/search.css', +] + +html_logo = "_static/flair_logo_white.svg" +html_show_sphinx = False # Napoleon settings napoleon_include_init_with_doc = True @@ -103,9 +119,7 @@ def linkcode_resolve(*args): html_sidebars = { "**": [ - "globaltoc.html", - "searchbox.html", - "versioning.html", + "globaltoc.html" ], "index": [], } diff --git a/docs/glossary/index.rst b/docs/glossary/index.rst deleted file mode 100644 index c732a1a121..0000000000 --- a/docs/glossary/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -Glossary -======== - -.. glossary:: - - Sentence - a sentence is a text-unit consisting of tokens, labels and possibly metadata. Notice that a sentence is not limited in size, hence a Sentence itself could hold either a full document, a paragraph, a simple phrase or a linguistic \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 3cff769118..c39010a2c7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,95 +1,20 @@ -flair -===== - .. _flair_docs_mainpage: +.. title:: Home -**Version**: |version| - -**Useful links**: -`Getting started `_ | -`Source Repository `_ | -`Issue Tracker `_ | - -Flair is a very simple framework for state-of-the-art Natural Language Processing (NLP) - -.. grid:: 2 - - .. grid-item-card:: - :img-top: ./_static/tutorial.svg - - Tutorial - ^^^^^^^^ - - New to Flair? Check out the Tutorials. It contains an introduction to Flair's main concepts. - - +++ - - .. button-ref:: tutorial/index - :expand: - :color: secondary - :click-parent: - - To the tutorials - - .. grid-item-card:: - :img-top: ./_static/api.svg - - API-docs - ^^^^^^^^ - - The API-docs provides in-depth information on the classes and functions designed for public use. - - +++ - - .. button-ref:: api/index - :expand: - :color: secondary - :click-parent: - - To the API docs - - .. grid-item-card:: - :img-top: ./_static/contributing.svg - - Contributor's Guide - ^^^^^^^^^^^^^^^^^^^ - - Want to add to the codebase? Can help add to the - documentation? The contributing guidelines will guide you through the - process of improving Flair. - - +++ - - .. button-ref:: contributing/index - :expand: - :color: secondary - :click-parent: - - To the contributor's guide - - .. grid-item-card:: - :img-top: ./_static/glossary.svg - - Glossary - ^^^^^^^^ - - Not sure what the exact meaning of certain terms is? Find their definition in the Glossary. - - +++ +.. raw:: html + :file: _templates/landing_page_styles.html - .. button-ref:: glossary/index - :expand: - :color: secondary - :click-parent: +.. raw:: html + :file: _templates/landing-page-banner.html - To the glossary +.. raw:: html + :file: _templates/landing-page-illustrations.html .. toctree:: :maxdepth: 3 :hidden: Tutorials - API reference - Contributing - Glossary \ No newline at end of file + API + Contributing \ No newline at end of file diff --git a/docs/legal-notice/index.rst b/docs/legal-notice/index.rst new file mode 100644 index 0000000000..585047fc11 --- /dev/null +++ b/docs/legal-notice/index.rst @@ -0,0 +1,15 @@ +Legal Notice +============ + +.. title:: Legal Notice + +.. raw:: html + :file: ../_templates/legal-notice-content.html + +.. toctree:: + :maxdepth: 3 + :hidden: + + Tutorials <../tutorial/index> + API <../api/index> + Contributing <../contributing/index> \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 0e8c4f6141..ff23c9f129 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,11 +1,12 @@ sphinx-github-style<=1.0.2 # 1.0.3 changes logic that breaks with sphinx-multiversion sphinx-autodoc-typehints myst-parser -sphinx +sphinx<8.0.0 importlib-metadata sphinx-multiversion pydata-sphinx-theme<0.14 sphinx_design +sphinx-autosummary-autocollect # previous dependencies that are required to build docs for later versions too. semver diff --git a/docs/tutorial/tutorial-training/how-to-load-prepared-dataset.md b/docs/tutorial/tutorial-training/how-to-load-prepared-dataset.md index ed29bea502..f5cd654ed7 100644 --- a/docs/tutorial/tutorial-training/how-to-load-prepared-dataset.md +++ b/docs/tutorial/tutorial-training/how-to-load-prepared-dataset.md @@ -168,7 +168,7 @@ from flair.data import MultiCorpus multi_corpus = MultiCorpus([english_corpus, german_corpus, dutch_corpus]) ``` -The [`MultiCorpus`](#flair.data.MultiCorpus) inherits from `[`Corpus`](#flair.data.Corpus), so you can use it like any other corpus to train your models. +The [`MultiCorpus`](#flair.data.MultiCorpus) inherits from [`Corpus`](#flair.data.Corpus), so you can use it like any other corpus to train your models. ## Datasets included in Flair diff --git a/docs/tutorial/tutorial-training/how-to-train-span-classifier.md b/docs/tutorial/tutorial-training/how-to-train-span-classifier.md index e5d32cb426..21c5ee7de7 100644 --- a/docs/tutorial/tutorial-training/how-to-train-span-classifier.md +++ b/docs/tutorial/tutorial-training/how-to-train-span-classifier.md @@ -1,8 +1,7 @@ # Train a span classifier Span Classification models are used to model problems such as entity linking, where you already have extracted some -relevant spans -within the {term}`Sentence` and want to predict some more fine-grained labels. +relevant spans within the `Sentence` and want to predict some more fine-grained labels. This tutorial section show you how to train models using the [Span Classifier](#flair.models.SpanClassifier) in Flair.