Skip to content

wip: structure for mobile native docs#2

Draft
tuanpt-0634 wants to merge 1 commit intomainfrom
sidebar-for-mobile-dev
Draft

wip: structure for mobile native docs#2
tuanpt-0634 wants to merge 1 commit intomainfrom
sidebar-for-mobile-dev

Conversation

@tuanpt-0634
Copy link
Copy Markdown
Contributor

Notes

  • Tạo document bằng cách tạo file .md hoặc folder con bên trong folder docs

  • Mỗi folder sẽ có 1 file _category_.json dùng để khai báo một số thuộc tính liên quan đến việc hiển thị ở sidebar

    Ví dụ

    {
      "label": "Native",
      "position": 5,
      "link": {
        "type": "generated-index"
      }
    }
    • label hiển thị ở sidebar với tên là Native
    • position = 5 hiển thị Native ở vị trí thứ 5, sau các item Tổng quan, Javascript, PHP, Ruby
    • link mặc định là type generated-index => cái này chưa cần quan tâm
  • Trong folder docs/native có thể có folder con với cấu trúc tương tự

  • Trong folder nếu có file .md thì nó cũng sẽ được hiển thị ở sidebar. Label của item trong sidebar được lấy theo thứ tự ưu tiên sau:

    1. Label mặc định là tên file
    2. Nếu file markdown có thẻ h1 ví dụ # Header thì label sẽ là Header
    3. Nếu file markdown có metadata thì label sẽ được lấy theo metadata. Ví dụ
    ---
    title: Best practices for android
    sidebar_position: 1
    ---

Ví dụ với cấu trúc các file trong pull request này thì sẽ sidebar sẽ hiển thị như hình bên dưới

image

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant