โค้ดกำหนดเองและโค้ดสแนิปเพตกับ GitHub
4 นาที
การผสานรวมกับ github ช่วยให้คุณซิงก์ โค้ดกำหนดเอง docid\ apyzrjey39et52vocyjcc customcss docid\ w8xuw2qnm2c ehjjpmvh4 , customjs , footertemplate , headertemplate , โดยตรงจากที่เก็บ github ตัวแปรเหล่านี้สามารถเป็นข้อความดิบหรือเชื่อมโยงไปยังไฟล์จากโฟลเดอร์ root ได้ คุณเพียงแค่ต้องกำหนดไฟล์ archbee json ใน repo ของคุณ และเพิ่มโค้ดกำหนดเองหรือ css กำหนดเอง เช่นในตัวอย่างนี้ archbee json { "root" "docfolderwithsummary", "structure" { "summary" "summary md", "assets" " archbee/assets" }, "customjs" "custom js", "customcss" " \n { font family \\"comic sans ms\\", cursive, sans serif; }", "footertemplate" "", "headerincludes" "" } summary md # table of contents \ \[introduction]\(introduction md) \## walkthroughs \ \[installing]\(walkthroughs/01 installing app md) \ \[adding event handlers]\(walkthroughs/02 adding event handlers md) \ \[defining custom elements]\(walkthroughs/03 defining custom elements md) \## docs \ \[configuring]\(docs/01 configuring app md) \ \[adding info]\(docs/02 adding info md) \ \[starting app ]\(docs/03 starting app md) custom js window archbee = window archbee || { queue \[], push function (x) {window archbee queue push(x)} }; window archbee push({ eventtype "init", spaceid "published 0auu0nj zflc52lh2yy5u", }); หากคุณส่งโค้ดไปยัง github, archbee จะอ่านการกำหนดค่าจาก archbee json ไฟล์และอัปเดต การตั้งค่า space > โค้ดกำหนดเอง ส่วนด้วยโค้ดใหม่ของคุณ ตัวอย่างโค้ด คุณสามารถเพิ่มตัวอย่างโค้ดใน github repo ของคุณได้ เพียงแค่ต้องกำหนดค่าไว้ใน config md ไฟล์นั้น ไฟล์ config md จะต้องอยู่ในโฟลเดอร์เดียวกับไฟล์ summary md ด้วย ด้านล่างนี้คือตัวอย่างไฟล์ config md config md ## use a file relative to docspath folder \ use{file="swagger v2 json#l2"} \## relative path to repo structure \ use{file="/app/package json#l1 l5"} \## relative path to docspath folder \ use{file=" /app/package json#l1 l5"} \## one single line \ use{file=" /app/package json#l5"} \## specify syntax, from and to parameters explicitly \ use{file="swagger v2 json" from="l6" to="l10" syntax="javascript"} ตัวอย่าง สมมติว่าคุณมีไฟล์ package json ด้านล่างนี้ (จากตัวอย่างด้านบน) และยังมีไฟล์ config md ด้วย config md ## specify syntax, from and to parameters explicitly \ use{file="swagger v2 json" from="90" to="127" syntax="javascript"} คุณจะเห็นสิ่งต่อไปนี้ในเอกสาร archbee หลังจากการนำเข้า "post" { "tags" \["pet"], "summary" "add a new pet to the store", "description" "", "operationid" "addpet", "consumes" \["application/json", "application/xml"], "produces" \["application/json", "application/xml"], "parameters" \[ { "in" "body", "name" "body", "description" "pet object that needs to be added to the store", "required" true, "schema" { "$ref" "#/definitions/pet" } } ], "responses" { "200" { "description" "success!" }, "405" { "description" "invalid input" } }, "security" \[ { "api key" \[] }, { "petstore auth" \["write\ pets", "read\ pets"] } ] },
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.