diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42aa6df --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/_site +**/obj \ No newline at end of file diff --git a/README.md b/README.md index 11185f0..9265f14 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,21 @@ -# docfx-material -A simple material theme for DocFX +# DocFX Material + +A simple material theme for DocFX. This is an override of the default template +so you need to enable both in the `docfx.json`. + +![DocFX Material Site](./sample/images/material-site.png) + +## Install + +1. Download the source or the zipped file from the release. +2. Create a `templates` folder in the root of your DocFX directory. +3. Copy the `material` folder to the `templates` folder. +4. Update the `docfx.json` configuration to include the material template: + ```json + { + "template": [ + "default", + "templates/material" + ], + } + ``` diff --git a/material/partials/head.tmpl.partial b/material/partials/head.tmpl.partial new file mode 100644 index 0000000..c05e8c1 --- /dev/null +++ b/material/partials/head.tmpl.partial @@ -0,0 +1,21 @@ +{{!Copyright (c) Oscar Vasquez. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + + + + + {{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}} + + + + {{#_description}}{{/_description}} + + + + + + + + {{#_noindex}}{{/_noindex}} + {{#_enableSearch}}{{/_enableSearch}} + {{#_enableNewTab}}{{/_enableNewTab}} + \ No newline at end of file diff --git a/material/styles/main.css b/material/styles/main.css new file mode 100644 index 0000000..dd8a80e --- /dev/null +++ b/material/styles/main.css @@ -0,0 +1,141 @@ +body { + color: #34393e; + font-family: 'Roboto', sans-serif; + line-height: 1.5; + font-size: 16px; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + word-wrap: break-word +} + +/* HEADINGS */ + +h1 { + font-weight: 600; + font-size: 32px; +} + +h2 { + font-weight: 600; + font-size: 24px; + line-height: 1.8; +} + +h3 { + font-weight: 600; + font-size: 20px; + line-height: 1.8; +} + +article h1, +article h2, +article h3, +article h4 { + margin-top: 35px; + margin-bottom: 15px; +} + +article h4 { + padding-bottom: 8px; + border-bottom: 2px solid #ddd; +} + +/* NAVBAR */ + +.navbar-brand>img { + color: #fff; +} + +.navbar { + border: none; + -webkit-box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); + -moz-box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); + box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); +} + +.subnav { + border-top: 1px solid #ddd; + background-color: #fff; + -webkit-box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); + -moz-box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); + box-shadow: 0px 1px 3px 0px rgba(100, 100, 100, 0.5); +} + +.navbar-inverse { + background-color: #0d47a1; + z-index: 100; +} + +.navbar-inverse .navbar-nav>li>a, +.navbar-inverse .navbar-text { + color: #fff; + background-color: #0d47a1; + border-bottom: 3px solid transparent; + padding-bottom: 12px; +} + +.navbar-inverse .navbar-nav>li>a:focus, +.navbar-inverse .navbar-nav>li>a:hover { + color: #fff; + background-color: #0d47a1; + border-bottom: 3px solid white; +} + +.navbar-inverse .navbar-nav>.active>a, +.navbar-inverse .navbar-nav>.active>a:focus, +.navbar-inverse .navbar-nav>.active>a:hover { + color: #fff; + background-color: #0d47a1; + border-bottom: 3px solid white; +} + +.navbar-form .form-control { + border: none; + border-radius: 20px; +} + +/* SIDEBAR */ + +.toc .level1>li { + font-weight: 400; +} + +.toc .nav>li>a { + color: #34393e; +} + +.sidefilter { + background-color: #fff; + border-left: none; + border-right: none; +} + +.sidefilter { + background-color: #fff; + border-left: none; + border-right: none; +} + +.toc-filter { + padding: 10px; + margin: 0; +} + +.toc-filter>input { + border: 2px solid #ddd; + border-radius: 20px; +} + +.toc-filter>.filter-icon { + display: none; +} + +.sidetoc>.toc { + background-color: #fff; + overflow-x: hidden; +} + +.sidetoc { + background-color: #fff; + border: none; +} \ No newline at end of file diff --git a/sample/api/index.md b/sample/api/index.md new file mode 100644 index 0000000..4aaffc0 --- /dev/null +++ b/sample/api/index.md @@ -0,0 +1,213 @@ +# Petstore API + +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + +## About + +| Url | Version | Contact | Terms of Service | License | +| ----------------------------------------------------------------- | ------- | --------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| [petstore.swagger.io/v2](http://petstore.swagger.io/v2 "API url") | 1.0.0 | [apiteam@swagger.io](mailto:apiteam@swagger.io "Contact Email") | [http://swagger.io/terms/](http://swagger.io/terms/ "Terms of Service") | [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html "License") | + +## Schemes + +| Scheme | +| ------ | +| https | +| http | + +## Endpoints + +### pet + +#### POST + +##### addPet + +Add a new pet to the store + +##### Expected Response Types + +| Response | Reason | +| -------- | ------------- | +| 405 | Invalid input | + +##### Parameters + +| Name | In | Description | Required? | Type | +| ---- | ---- | ---------------------------------------------- | --------- | ---------------------- | +| body | body | Pet object that needs to be added to the store | true | [Pet](#pet-definition) | + +##### Content Types Produced + +| Produces | +| ---------------- | +| application/xml | +| application/json | + +##### Content Types Consumed + +| Consumes | +| ---------------- | +| application/json | +| application/xml | + +##### Security + +| Id | Scopes | +| ------------- | ---------- | +| petstore_auth | write:pets | + +#### PUT + +##### updatePet + +Update an existing pet + +##### Expected Response Types + +| Response | Reason | +| -------- | -------------------- | +| 400 | Invalid ID supplied | +| 404 | Pet not found | +| 405 | Validation exception | + +##### Parameters + +| Name | In | Description | Required? | Type | +| ---- | ---- | ---------------------------------------------- | --------- | ---------------------- | +| body | body | Pet object that needs to be added to the store | true | [Pet](#pet-definition) | + +##### Content Types Produced + +| Produces | +| ---------------- | +| application/xml | +| application/json | + +##### Content Types Consumed + +| Consumes | +| ---------------- | +| application/json | +| application/xml | + +##### Security + +| Id | Scopes | +| ------------- | ---------- | +| | | +| petstore_auth | write:pets | + +### pet/findByStatus + +#### GET + +##### findPetsByStatus + +Finds Pets by status +Multiple status values can be provided with comma separated strings + +##### Expected Response Types + +| Response | Reason | +| -------- | -------------------- | +| 200 | successful operation | +| 400 | Invalid status value | + +##### Parameters + +| Name | In | Description | Required? | Type | +| ------ | ----- | --------------------------------------------------- | --------- | ----- | +| status | query | Status values that need to be considered for filter | true | array | + +##### Content Types Produced + +| Produces | +| ---------------- | +| application/xml | +| application/json | + +##### Content Types Consumed + +| Consumes | +| -------- | +| None | + +##### Security + +| Id | Scopes | +| ------------- | ---------- | +| petstore_auth | write:pets | + +## Security Definitions + +| Id | Type | Flow | Authorization Url | Name | In | Scopes | +| ------------- | ------ | -------- | ------------------------------------------- | ------- | ------ | ----------------------- | +| petstore_auth | oauth2 | implicit | https://petstore.swagger.io/oauth/authorize | | | :write:pets, :read:pets | +| api_key | apiKey | | | api_key | header | | + +| Scope | Description | +| ---------- | --------------------------- | +| | modify pets in your account | +| write:pets | read your pets | + +## Definitions + +### ApiResponse Definition + +| Property | Type | Format | +| -------- | ------- | ------ | +| code | integer | int32 | +| type | string | | +| message | string | | + +### Category Definition + +| Property | Type | Format | +| -------- | ------- | ------ | +| id | integer | int64 | +| name | string | | + +| Property | Type | Format | +| -------- | ------- | --------- | +| id | integer | int64 | +| petId | integer | int64 | +| quantity | integer | int32 | +| shipDate | string | date-time | +| status | string | | +| complete | boolean | | + +### Pet Definition + +| Property | Type | Format | +| --------- | -------------------------------- | ------ | +| id | | int64 | +| category | integer | | +| name | [Category](#category-definition) | | +| photoUrls | string | | +| tags | array | | +| status | array | | + +### Tag Definition + +| Property | Type | Format | +| -------- | ------- | ------ | +| id | integer | int64 | +| name | string | | + +### User Definition + +| Property | Type | Format | +| ---------- | ------- | ------ | +| id | integer | int64 | +| username | string | | +| firstName | string | | +| lastName | string | | +| email | string | | +| password | string | | +| phone | string | | +| userStatus | integer | int32 | + +## Additional Resources + +[Find out more about Swagger](http://swagger.io "External Documentation") diff --git a/sample/api/toc.yml b/sample/api/toc.yml new file mode 100644 index 0000000..f11ea06 --- /dev/null +++ b/sample/api/toc.yml @@ -0,0 +1,2 @@ +- name: Petstore API + href: index.md diff --git a/sample/articles/content2.md b/sample/articles/content2.md new file mode 100644 index 0000000..0a43eb8 --- /dev/null +++ b/sample/articles/content2.md @@ -0,0 +1,68 @@ +# Rigidum iuvenis referat iamque Maera habebat quid + +## Rotatis corpora aliquid regnum et sequerer + +Lorem markdownum in interea, in angues ausa facit **solita**. Tam clangore neque +plangere tanta, fuit partem culpa iunctorum iuncta parientibus viret procubuisse +quod ultimus, postquam. Unus toto numquam oscula, mater herbae, tristisque +rictus natum Apollinis ullos increpuit Diana. Ut tamen vos, in videtur semper +cum contentus fagus. + +Serta fovesque augusta terra vela: inter quam supplex, et. Harpe [umquam +fert](http://constitit.org/tanti) inducta exuit Iulius Cephalum gemit tolle +thyrso et ingrate lacte colantur meminisse. Macies meminitque illi; esse ante +fortissime ignes, si. Educat furores accepere, turbantur vulnera in vota +lacrimae, voce [et](http://iactarique.com/) ullis sedent. + +> Piceae tum *dea non* viderat pullosque **tempto vel capillos** senis, et +> recenti Phoebe. Et Amuli *de* victos thalami, pavet usus auro est sua. Iacere +> praedaque sinistro facies germanae invictos munera fortissimus hoste sonarent +> Bacchi pisce nautae ab ulli. Corporibus nodus undas, more, **sonant in** retro +> vina remittat illa tum; hic. + +## Cantusque laetus + +Et ille. Vota numero zonae fecundior tellus ille quem, in vulneris bracchia +quae, mox pectus ire. Ego arcus nactus, nec rictus, in manibus nati est quem +fecundo nomina [male nodis satis](http://spiramenta-nyseides.com/) una sed +vidit. + +- Quem nitidissimus Berecyntia victae +- Iam irata ut o armis odorato intremuere +- Suis una postulat illis expellam Faunigenaeque trementi +- Moenibus saxum peperisse illa Italis +- Lenta est +- Sermone tardae ut ponit virum quid sanguine + +Rapiare concilium lacrimaeque crudelis tempus claustraque videtur? In et mira +sperato placuere sinisterior regis profundum dixit aemula! Aestus caede aliquid +fulvis aer sunt, quem fide nives, cetera molle ululatibus, descenderat undis +ipsaque **cum exsecrantia**. + +## Erat ingeniis + +Est [sibi quoniam his](http://www.candentia-haurire.com/) morte dea tellus +aestibus imaginis e que vel nec! Verentur amomo. Quid non popularis in prioris +convexi remos sua, quisquis ut illa nomen, [aequor urbis](http://agros.net/). +Frondescere fata [excutiuntque](http://valuitambos.net/spernitque.aspx) Hylonome +matrem! + + var error = whitelist; + username.dos = web.eup_restore.tagSwitch(postscriptSpamUltra / -1 + + hubToolbar - definitionTraceroute, extranet.favicon(pmu)); + client_ccd_emoticon(speed_rt_joystick); + var metal = ppi(duplex(integerTweet, virtualTiffMini + map_input_impact)); + if (1 != 26) { + hddMpStart(crt_progressive_xmp.touchscreen_processor_hard.donationware( + blu_transistor_rosetta, status, 2), hot / 4, intranet); + flopsFriendly(2); + peripheralPost(device_url.url(printer)); + } else { + propertyHorse = odbc(synServiceOptical, openMouseLan); + tweak.language = smartphoneSmmAddress(snippet_file_sink + 3); + } + +Ab dona partibus orbem auras telum, mutant totidemque ipse cribri +[sternuntur](http://www.ferro-dicere.io/tenuis) solverat. *Quoque* sonuere *ne +iniuria* carpere. Draconum leporem. Sed mixta conscia nisi lupi auxilio. Litora +iuventus annis. \ No newline at end of file diff --git a/sample/articles/content3.md b/sample/articles/content3.md new file mode 100644 index 0000000..7611210 --- /dev/null +++ b/sample/articles/content3.md @@ -0,0 +1,63 @@ +# Virginea carnes mulcere excutit + +## Rotarum lupi + +Lorem markdownum superest excipis bracchia nomine: non cogit senior crepuscula +superstes barbam [audaci colla](http://etsed.net/). Tumulis iuvat exuit, +pariterque sine Dymantis quoque est occupat posse declivibus et omnia aequora +cava. Nec nobis oculis steterat rigorem. + +> Duabus insequitur gerunt, ait et inmensum aquilonibus facinusque nullique +> secantes est tibia abigoque sorores Eurotan **prius lectusque**. Figitur loco. + +## Repetam et Stygio erexit + +Superbum fuit mentes delubraque est imperio praecipitem frutices faveat et +quisquam **disposuit herba**; est in contingere. Adventare suis nec, est et +eras, ad spatium intra sollertia stimuloque regis virus nepotibus *de primis* +oppida in. Illud ostendens Acheloe infelix hastae simul? + + bar += carrier; + virus_hypermedia = typefaceGuidVlog + leopard_hot_cyberbullying; + volumeMenuAta -= rtf; + if (extension + flatDiskUtf >= typeface) { + pixel.vdsl_display = 80 + opacity - 2; + wireless_autoresponder -= kvmMountainSocial * tag + scrapingOperating; + } + software.table_dma_netiquette += directory_dimm_disk.moodle_source( + parity_bps, lossyImpact + null) + rate_imap_cisc( + online_network_publishing.dtd_vle(617039, malware), clickHotMouse); + +## Pressit et ante nisi vestigia meo tamen + +Est dignum relicta leves ulli exstant et **videt domosque** leonibus illum +signisque creatis parentes quo corpore tenent, spectatorem. Cum inquit per. + +In caelum violentia ille altera [silvis](http://cogetnec.io/), ad *falsa*. +Visaque superata Iamque [ab lacerata](http://www.vitiatas-cedunt.com/) pectore +sacrata, [dedit](http://www.pendere-ab.com/voce-papyriferi.html) conata +impleverat novitate in terris orbem **sedes**, abstulerat? Fovit cognovit, +dixerat uritur, Iuno credi, erat latet? Cernis *natas nec* et, **illi tamen** +indicium, non possit fletus Laomedonta! Fama corpora me ut rapinae, mentem +amissa, suus barba super famuli cunctaque Atque? + +## Corporis magnae sic totos sacra est nec + +Vocantem fatale discedere; Lyncides [veretur de +gestae](http://et-in.net/ut-aeolia) aequos! Othrys neque, deficiunt laudemur +spelunca longe cladis, quique: modo? Dixit omnipotens dique voluit quoque +relabi, tum auras mollibus et. + +Sumus morientem omnem et post illa aliqua si, aequor. Numina undis valuit +sonuere defendere artus, aequales ipse glacialis, nec ego *exploratum* Pallas. +Coniugis remige nitidissimus fui perstat nuribusque quinos, factus. Sic sumus +ante? + +Nostro **nos cera** raptor teneat. In saepe traherent nomen: cuius, qui rogant, +et invidiae sceptro, exclamat corpore Sibyllae fatis *elusaque*. [Maia +illum](http://marte-austri.net/thalamiquesepulcro) ferro faciem cetera rex +paratus iter sequantur fac regno regnarat Iunoni *permulsit factos*. Quod illo +non faece numine in cursus; est usus. [Draconem +sanguine](http://non-parva.com/) inpressa movetur, stantem [precari +semianimesque contigit](http://poscimusiterumque.org/) mactatur valvis trahens +in candidus vestes et ad! \ No newline at end of file diff --git a/sample/articles/intro.md b/sample/articles/intro.md new file mode 100644 index 0000000..645e91e --- /dev/null +++ b/sample/articles/intro.md @@ -0,0 +1,78 @@ +# Fallere antiquam thyrso visceribus + +## Si mandate videt + +Lorem markdownum perspice caelestia orsa tamen rorant titulum Amycus parens +deplangitur [fuit est](http://ultorem-hunc.net/exstantequos); duxit cura est. +Idem [praepetibus sibi](http://est.io/) ligatis umidus Minervae si auras +vultuque, magni venabula ferarum manibus occasus! + +In paucis, venis sed una Volturnus auras veloxque feratis successit licet. Oras +Nestor hoc nymphae belua. Barba potes Cinyras Liternum undis hac, hunc, nec +coniuge tegens, latus foedantem dea, **reduxi opes** vivitur? Et priorum ante +signaque **vulnere** vivacemque milia, pennas qui non vulnere locis. Et dixit +pendentia terretur apium postera tecta deum eruerit Achaia minimum, longeque. + +Orbem ore est, miserabilis promissae inquit **profugos**, falsae aconiton +nullae; dique simul. Eris deum cepit furoris nympha. Dies iste telae cum +fidelius, mihi esse est nominat quod, Anaxareten. Venit Confremuere, inplet, +tibi inspiciunt iamque maesta his suis. + + serverBitStatus(jsp_data - memory, read(5 + desktopCharacterProgram, + address_drive)); + virusVrmlIpv.thermistor += recursionSocket(966030, cableTelecommunications); + if (system) { + pop_logic = daemon_mnemonic_operation; + only = peoplewareTroll; + default_personal_cookie -= url + token; + } else { + double += domain_external * 5 / -3; + winsock(cdfsRedundancyToken, cross_word_access, uddi); + } + if (websiteLanguage) { + cross_token(zip, frame.mbr(4)); + golden.backsideOsMenu += serp; + whiteRestore.videoDimmOpen += mountPlain * 15; + } else { + spool.irc = play_suffix; + cmos += 96; + artUpImpact.leafWebmasterHorse = domainBrowser; + } + +## Rogavi umeris tulisse + +Pictas leto vix novem nitidi mentem Phoeboque, inposuere incubat thalamo: +mugitibus. Busto siquid adspexerit venerit [ +tenentibus](http://mundiclivo.org/aliiinplevit) suo [habet ardet +Troes](http://tamen.io/). Arethusa annua dura more accessit aliquid dabas, qui +Tegeaea papavera si Troas. + +- Vota ipsa in peremi +- Possent anhelatos +- Poena quem +- Nutrit super eodem +- Donis adhaesit requiemque petit Antaeo sustinet feram + +Studeat occupat viro talia truncas pectine redit crimina divum illud, precesque +et Minos, quidquid gratia. Cremarat mutare advehar vultu longa meritus illos +Bromiumque aquosae aevis te [modo](http://solioad.com/) forma, legi robora: plus +arbor latrator. Palluit in quanta mitte miluus; amantes hominesque imago, si +Ianthe, unda. Acies in vulnere secum, forte, barba fumo solet ignibus; sanguine! + + if (webcamSystem.modemPointClob(3) < 14) { + yobibyteReimage = simplex_readme / 4 + responsive_server; + } else { + big(thumbnailVirtual, data_primary_lamp); + } + kibibyte_protector_active += nocPackBridge + white; + var firewall_socket_bus = up; + module_carrier += webmail_source_hardware(us, metadata, radcab - 3) - 3; + cpcPartitionLink *= sessionSoa / surface * systemHacker; + +Nutantem spatiis, corruat memor in sed nate, auro, ora amissa fatidicus et. +Manusque amore spectabat [tyranni](http://www.inposito-quam.io/quotquae.html) +ipsa **Mimasque**, et tum post parvo, dedit vires et aestus et Rhoetus! Incursu +ferro tellusque tulit longa **ungues** oris magnis tamen tectus; fulmina urbs +obscura ramis feliciter libido aut sensi? Vidi oenea puppibus amanti, pro +foliis, hoc est amicitiae et! Caput favorem, inimica in spinae hoc simul +stantibus pependit opesque pericula avorum paene. \ No newline at end of file diff --git a/sample/articles/toc.yml b/sample/articles/toc.yml new file mode 100644 index 0000000..8837398 --- /dev/null +++ b/sample/articles/toc.yml @@ -0,0 +1,6 @@ +- name: Introduction + href: intro.md +- name: 'Secondary Content' + href: content2.md +- name: 'More Content' + href: content3.md diff --git a/sample/docfx.json b/sample/docfx.json new file mode 100644 index 0000000..8a2ddfe --- /dev/null +++ b/sample/docfx.json @@ -0,0 +1,46 @@ +{ + "build": { + "content": [ + { + "files": [ + "articles/**.md", + "articles/**/toc.yml", + "toc.yml", + "*.md", + "api/**.md", + "api/**/toc.yml" + ] + } + ], + "resource": [ + { + "files": [ + "images/**" + ] + } + ], + "dest": "_site", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default", + "../material" + ], + "postProcessors": [], + "markdownEngineName": "markdig", + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false, + "globalMetadata": { + "_appFooter": "Copyright © 2019 Oscar Vasquez
Generated by DocFX
", + "_enableSearch": "true", + "_disableContribution": "false", + "_gitContribute": { + "repo": "https://github.com/ovasquez/docfx-material", + "branch": "develop" + }, + "_gitUrlPattern": "github" + } + } +} \ No newline at end of file diff --git a/sample/images/material-site.png b/sample/images/material-site.png new file mode 100644 index 0000000..c029419 Binary files /dev/null and b/sample/images/material-site.png differ diff --git a/sample/index.md b/sample/index.md new file mode 100644 index 0000000..3a46ddf --- /dev/null +++ b/sample/index.md @@ -0,0 +1,21 @@ +# DocFX Material + +A simple material theme for DocFX. This is an override of the default template +so you need to enable both in the `docfx.json`. + +![DocFX Material Site](./images/material-site.png) + +## Install + +1. Download the source or the zipped file from the release. +2. Create a `templates` folder in the root of your DocFX directory. +3. Copy the `material` folder to the `templates` folder. +4. Update the `docfx.json` configuration to include the material template: + ```json + { + "template": [ + "default", + "templates/material" + ], + } + ``` diff --git a/sample/toc.yml b/sample/toc.yml new file mode 100644 index 0000000..5e6a642 --- /dev/null +++ b/sample/toc.yml @@ -0,0 +1,5 @@ +- name: Articles + href: articles/ +- name: API + href: api/ + homepage: api/index.md