LeCoupa/docs.adonisjs.com — dự án mã nguồn mở — đang có 3 sao GitHub. 📚 Source code and documentation for the official docs website.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Source code and documentation for the official documentation website hosted on docs.adonisjs.com
Setup
Follow the below mentioned steps to setup the project on your local.
Fork the repo
Pull the repo on your local
Install all dependencies using npm install.
Start the AdonisJS development server using node ace serve --watch
We do not follow any build process for rendering markdown to HTML. Instead, we compile markdown files on every page request. This ensures, we do not have to run any background compilers to compile markdown and then re-compile everything on a single change. The process is as simple as
--> New HTTP request --> Finding markdown file for the url --> Compile and serve it
Environment variables
Following environment variables are required to start the development server or create the production build.
The ALGOLIA_API_KEY environment variable is optional and required only if you want to enable search.
If you are deploying a translated version of the docs, then set the COPY_REDIRECTS_FILE=false. Since the redirects file is applicable only for the official documentation to avoid breaking the preview.adonisjs.com URLs.
Content structure
The markdown content is saved inside the content directory and each documentation type (we call them zones) has its own subfolder.
The navigation for the website header and the sidebar is driven by the menu.json file inside each zone's subdirectory.
The top level object is the group name. You can have one or more groups inside a zone and they will be listed in a dropdown in the header nav.
If there is no only one group. You can name it as root.
Each group can have one or more categories. The categories are listed inside the sidebar.
The category with name root will not be printed in the HTML.
Each category can have one or more docs.
The docs further have a title, permalink and the path to the content file. The path is relative from the zone root.
Rendering HTML
We make use of a self written @dimerapp/content module to render markdown to HTML using Edge templates in the middle.
We begin by first converting Markdown to an AST and then render each node of the AST using Edge templates. This allow to spit custom markup. Checkout the ./resources/views/elements directory to see how we are using it.
The code blocks are rendered using the shiki. The module uses VsCode grammar and themes to process the code blocks. Also, code blocks are processed on the backend and the client receives formatted HTML.
Configuring @dimerapp/content
The @dimerapp/content module does not come with any CLI or opinions on how the content should be structured.
So we have to self configure @dimerapp/content module. This is done inside the start/content.ts file, which relies on the config/markdown.ts file.
CSS and frontend JavaScript
The styles are written in Vanilla CSS and stored inside the ./resources/css directory. To organize things a bit, we have split them inside multiple .css files.
We also make use of Alpine.js for adding small interactive components, like the header nav dropdown and the codegroup toggle.
The @hotwire/turbo is used to navigate between pages without doing a complete refresh.
Custom JS Hacks
Re-rendering HTML pages resets the scroll position of the sidebar, which is kind of annoying. So we make use of turbo events turbo:before-render and turbo:render to store the sidebar position and then restore it after navigation.
On first page visit, we scroll the active sidebar item into the view using the scrollIntoView method.
Deployment
Run the following command to create the production build.
npm run build
The output is written to the public directory and you can deploy it on any host capable of serving static files.
The official website is hosted on pages.cloudflare.com
Important environment variables
The ALGOLIA_API_KEY environment variable is optional and required only if you want to enable search.
If you are deploying a translated version of the docs, then set the COPY_REDIRECTS_FILE=false. Since the redirects file is applicable only for the official documentation to avoid breaking the preview.adonisjs.com URLs.
Translating docs to different languages
You are free to fork this repo and translate docs to different languages and publish them on a separate subdomain.
Disclaimer: The translated documentation is considered a community effort. The website and translations are/will never be supported or maintained by the core team.
Process for translating docs
Notify everyone about the translated docs on this pinned issue.
We can issue you a subdomain for the language once you have translated more than 50% of the docs.
As the documentation is updated on the official website, we will drop a link to the PR on the pinned issue and you can pull back those changes.
We recommend not localizing the URLs. Just translate the docs content.
Feel free to send a PR to Algolia for indexing the translated website. Here is a reference to algolia config for the official website.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/LeCoupa/docs.adonisjs.com là nguồn chính thức.
LeCoupa/docs.adonisjs.com có bao nhiêu sao?
LeCoupa/docs.adonisjs.com có 3 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/LeCoupa/docs.adonisjs.com. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
LeCoupa/docs.adonisjs.com có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho LeCoupa/docs.adonisjs.com. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
LeCoupa/docs.adonisjs.com còn đang phát triển không?
Commit gần nhất trên LeCoupa/docs.adonisjs.com là 3.6 năm trước (theo timestamp GitHub). Repo có 1 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
LeCoupa/docs.adonisjs.com là gì?
LeCoupa/docs.adonisjs.com (LeCoupa/docs.adonisjs.com) là dự án TypeScript trên GitHub. Theo mô tả gốc: 📚 Source code and documentation for the official docs website.
LeCoupa/docs.adonisjs.com viết bằng ngôn ngữ gì?
LeCoupa/docs.adonisjs.com chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về docs.adonisjs.com?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về docs.adonisjs.com.