{"id":20044916,"url":"https://github.com/gryf/gitea-rest-renderer","last_synced_at":"2026-06-13T09:31:55.236Z","repository":{"id":42591484,"uuid":"510874803","full_name":"gryf/gitea-rest-renderer","owner":"gryf","description":"ReStructured Text renderer for Gitea","archived":false,"fork":false,"pushed_at":"2022-07-06T14:56:32.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T07:38:38.272Z","etag":null,"topics":["gitea","restructured-text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gryf.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-05T19:48:39.000Z","updated_at":"2022-09-15T10:58:59.000Z","dependencies_parsed_at":"2022-09-21T21:23:45.278Z","dependency_job_id":null,"html_url":"https://github.com/gryf/gitea-rest-renderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gryf/gitea-rest-renderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryf%2Fgitea-rest-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryf%2Fgitea-rest-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryf%2Fgitea-rest-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryf%2Fgitea-rest-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gryf","download_url":"https://codeload.github.com/gryf/gitea-rest-renderer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gryf%2Fgitea-rest-renderer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34279898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitea","restructured-text"],"created_at":"2024-11-13T11:02:38.288Z","updated_at":"2026-06-13T09:31:55.219Z","avatar_url":"https://github.com/gryf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Restructured text renderer for Gitea\n====================================\n\nThis is simple custom rst2html5 renderer for `Gitea`_ for reStructuredText\nfiles.\n\n\nInstallation\n------------\n\nBefore starting deployment of Gitea using docker or docker-compose, you'll need\nto create an altered image which would contain `docutils`_ and `pygments`_\npython packages. There is a simple Dockerfile attached, which can be adjusted\nto your needs (i.e. it might be needed to pin to stable version of gitea), than\nlet's assume, that we tag the image with ``:rst``:\n\n.. code:: shell\n\n   $ docker build -t gitea:rst -f Dockerfile .\n\nProcedure of running dockerized deployment is `same as documented`_ - of course\nyou'll need to change line with image to align newly created altered image.\n\n\nNow, as you have it up and running, there is still a need for altering\nconfiguration. Stop the container, and alter file\n``path-to/gitea/conf/app.ini``, and add external renderer section:\n\n.. code:: ini\n\n   [markup.restructuredtext]\n   ENABLED = true\n   FILE_EXTENSIONS = .rst\n   RENDER_COMMAND = \"rst2htmlbody\"\n   IS_INPUT_FILE = false\n\n(see also section below)\n\nAnd that's it! You can run your gitea instance again and enjoy html generated\npreview for reStructuredText.\n\nUnfortunately, you'll need to repeat those steps every time you'd like to\nupdate gitea.\n\n\nSyntax highlighting\n-------------------\n\nGitea already have syntax highlighting support for markdown files, which uses\n`chroma`_ library which, as description says is heavily based on `pygments`_,\nwhich is pretty convenient, since it shares most of the mechanisms and ideas,\nincluding naming convention for the language elements inside ``code`` block. In\nother words, it seem to be super easy to adopt this little program to include\nalso syntax highlighting, instead of generating (i.e. by using ``pygmentize``\ncommandline tool) and adding separate CSS file as another step.\n\nThe only thing which is needed to include is the ``class`` attribute for HTML\nelement for ``code`` tag. To achieve that it's just a matter of additional\nentry in ``app.ini``, and that can be done together with altering ``app.ini``\nfrom previous section:\n\n.. code:: ini\n\n   [markup.sanitizer.restructuredtext.1]\n   ELEMENT = code\n   ALLOW_ATTR = class\n\nAnd that should be enough for having colored syntax highlighting.\n\n\nTesting\n-------\n\nYou don't need to run docker-compose for running container based on the image,\nfor testing purposes you could just run:\n\n.. code:: shell\n\n   $ docker build -t gitea:rst -f Dockerfile .\n   $ docker run --name gitea-test -p 3000:3000 -p 3022:22 -v ${PWD}/data:/data gitea:rst\n\nAdjust the settings in a browser, wait for them to propagate, than ``ctrl-c``\nto stop container, change the ``app.ini`` and start it again with:\n\n.. code:: shell\n\n   $ docker start gitea-test\n\n\nLicense\n-------\n\nThis project is licensed under the MIT License. See the LICENSE file for the\nfull license text.\n\n\n.. _docutils: https://docutils.sourceforge.io\n.. _gitea: https://gitea.io\n.. _same as documented: https://docs.gitea.io/en-us/install-with-docker/\n.. _chroma: https://github.com/alecthomas/chroma\n.. _pygments: http://pygments.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgryf%2Fgitea-rest-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgryf%2Fgitea-rest-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgryf%2Fgitea-rest-renderer/lists"}