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

feat: introduce ablog plugin #11

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pygments = "*"
sphinx-github-role = { git = "https://github.com/astrojuanlu/sphinx-github-role.git", ref = "main", editable = true }
myst-parser = "*"
sphinxcontrib-spelling = "*"
ablog = "*"

[dev-packages]

Expand Down
161 changes: 160 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions source/_ext/vineflower_site_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import os.path
import re

from sphinx.application import Sphinx
Expand All @@ -31,6 +32,7 @@
def setup(app: Sphinx):
app.add_role("mojira", mojira_role)
app.add_role("java", highlight_role("java"))
app.add_html_theme("vineflower_theme", os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..', '..', 'vineflower_theme'))


_issue_regex = re.compile(r'[A-Z]+-[1-9][0-9]*')
Expand Down
57 changes: 42 additions & 15 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
if release.endswith('-SNAPSHOT'):
tags.add('draft')

html_baseurl = "https://vineflower.org/"
if 'GITHUB_REF' in os.environ:
ref = os.environ['GITHUB_REF']
if ref.startswith("refs/pull/"):
Expand All @@ -43,8 +44,7 @@

Please consult the pull request to view any discussion and existing reviews.
"""
else:
html_baseurl = "https://vineflower.org/"
html_baseurl = f"https://vineflower.github.io/vineflower-site-previews/pull/{pr_number}/"

# -- General configuration ---------------------------------------------------

Expand All @@ -55,14 +55,16 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'ablog',
'myst_parser',
'sphinx_copybutton',
'sphinx_design',
'sphinx_github_changelog',
'sphinx_github_role',
'sphinx_substitution_extensions',
'sphinxcontrib.spelling',
'vineflower_site_extensions'
'vineflower_site_extensions',
'sphinx.ext.intersphinx'
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -82,24 +84,13 @@
pygments_style = 'friendly'
pygments_dark_style = 'dracula'

myst_enable_extensions=[
"colon_fence",
"deflist",
"fieldlist",
"dollarmath",
"html_admonition",
"replacements",
"smartquotes",
"tasklist"
]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'furo'
html_theme = 'vineflower_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand All @@ -120,13 +111,49 @@
},
'sidebar_hide_name': True
}
html_sidebars = {
'**': [
'sidebar/brand.html',
'sidebar/search.html',
'sidebar/scroll-start.html',
'ablog/postcard.html',
'sidebar/navigation.html',
'ablog/archives.html',
'sidebar/ethical-ads.html',
'sidebar/scroll-end.html',
'sidebar/variant-selector.html'
]
}

html_title = f'Vineflower (v{release})'
html_show_sourcelink = False
html_copy_source = False

html_favicon = '_static/favicon.ico'

# ablog
blog_title = 'Vineflower News'
blog_baseurl = html_baseurl
blog_path = 'news'
blog_languages = {
'en': ('English', None)
}
blog_default_language = 'en'
blog_post_pattern = 'news/*.md'

# myst_parser
myst_enable_extensions=[
"colon_fence",
"deflist",
"fieldlist",
"dollarmath",
"html_admonition",
"replacements",
"smartquotes",
"tasklist"
]
myst_update_mathjax = False

# sphinx-github-role
github_default_org_project = ('Vineflower', 'vineflower')

Expand Down
10 changes: 8 additions & 2 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ Vineflower
Vineflower is a modern Java decompiler aiming to be as accurate as possible, while not sacrificing the readability of the generated code. Vineflower supports modern Java (J20+), automatic reformatting of output code, and multithreaded decompilation. The main repository for Vineflower is located on GitHub at `Vineflower/vineflower <https://github.com/Vineflower/vineflower>`_.

Downloads
============
=========

The primary mode of distribution for Vineflower is the jar, which can be found on the `releases page <https://github.com/Vineflower/vineflower/releases>`_ on GitHub, which can also found on maven. There is also an `Intellij Plugin <https://plugins.jetbrains.com/plugin/18032-quiltflower>`_ for use.


Socials
=========
=======

To get in touch for queries, please check out the socials_ page.

News
====
.. postlist:: 5
:sort:

:ref:`See all... <blog-posts>`

.. the auto-generated TOC already exists in the sidebar, let's not show it here

Expand Down
8 changes: 8 additions & 0 deletions source/news/2023-07-11-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
blogpost: true
date: Jul 10, 2023
---

# Hello world

Hi there!
Loading