Benutzerdefinierter Code & Code-Snippets mit GitHub
4 min
die integration mit github ermöglicht es ihnen, die benutzerdefinierter code docid\ cr4sxswvdpvsjvz7dd5ab benutzerdefiniertescss docid\ hhtgq5bjahdlmeyucx6ky , customjs , footertemplate , headertemplate , direkt aus dem github repository zu synchronisieren diese variablen können rohtext sein oder auf eine datei aus dem stammverzeichnis verweisen sie müssen nur die datei archbee json in ihrem repository definieren und ihren benutzerdefinierten code oder ihr benutzerdefiniertes css hinzufügen, wie in diesem beispiel 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", }); wenn du den code auf github hochlädst, liest archbee die konfiguration aus der archbee json datei und aktualisiert automatisch den abschnitt space einstellungen > benutzerdefinierter code mit deinem neuen code code snippets sie können code snippets in ihrem github repository hinzufügen, sie müssen sie nur in der config md datei konfigurieren die config md datei muss im selben ordner wie die summary md datei abgelegt werden unten finden sie ein beispiel für eine config md datei 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"} beispiel angenommen, sie haben die folgende package json datei (aus dem obigen beispiel) und außerdem die config md datei config md ## specify syntax, from and to parameters explicitly \ use{file="swagger v2 json" from="90" to="127" syntax="javascript"} sie werden folgendes im archbee‑dokument nach dem import sehen "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.