├── .gitattributes ├── .github └── workflows │ └── test.yml ├── .gitignore ├── BACKING_UP_DATA.md ├── COMPETITORS.md ├── IMPLEMENTATION.md ├── README.md ├── REQUIREMENTS.md ├── bin └── .folder_keeper ├── docs ├── instructional │ ├── data_flow.monopic │ ├── data_flow.png │ └── data_flow.svg └── ui_proposals │ ├── vim_proposal.monodraw.monopic │ ├── vim_proposal_creating.png │ └── vim_proposal_creation.png ├── linux ├── Dockerfile ├── make.buildenv.sh └── make.release.sh ├── site ├── archetypes │ └── default.md ├── build │ └── Dockerfile ├── commit_gh_pages_files.sh ├── config.toml ├── content │ ├── comment.md │ └── getting_started.md ├── layouts │ ├── index.html │ ├── partials │ │ └── hook_left_sidebar_logo.html │ └── shortcodes │ │ ├── aside.html │ │ ├── notice.html │ │ ├── success.html │ │ └── warning.html ├── prep_for_gh_pages.sh ├── static │ └── images │ │ ├── data_flow.svg │ │ ├── logo.idraw │ │ ├── logo.png │ │ └── logo.svg └── themes │ ├── docuapi │ ├── .gitignore │ ├── LICENSE.md │ ├── Makefile │ ├── README.md │ ├── archetypes │ │ └── default.md │ ├── assets │ │ ├── images │ │ │ └── logo.psd │ │ ├── javascripts │ │ │ └── app │ │ │ │ └── _lang.js │ │ └── stylesheets │ │ │ ├── _docuapi.scss │ │ │ └── monokai.css │ ├── bundler.go │ ├── exampleSite │ │ ├── .gitignore │ │ ├── config.toml │ │ ├── content │ │ │ ├── errors.md │ │ │ ├── errors.nn.md │ │ │ ├── main.md │ │ │ └── main.nn.md │ │ ├── layouts │ │ │ └── partials │ │ │ │ ├── hook_head_end.html │ │ │ │ └── hook_left_sidebar_end.html │ │ └── static │ │ │ ├── .gitkeep │ │ │ └── _headers │ ├── i18n │ │ ├── en.yaml │ │ └── nn.yaml │ ├── images │ │ ├── screenshot.png │ │ └── tn.png │ ├── layouts │ │ ├── 404.html │ │ ├── _default │ │ │ └── baseof.html │ │ ├── index.html │ │ └── partials │ │ │ ├── hook_body_end.html │ │ │ ├── hook_head_end.html │ │ │ ├── hook_left_sidebar_end.html │ │ │ ├── hook_left_sidebar_logo.html │ │ │ ├── hook_left_sidebar_start.html │ │ │ ├── js.html │ │ │ ├── styles.html │ │ │ └── translations.html │ ├── static │ │ ├── images │ │ │ └── logo.png │ │ └── slate │ │ │ ├── fonts │ │ │ ├── slate.eot │ │ │ ├── slate.svg │ │ │ ├── slate.ttf │ │ │ ├── slate.woff │ │ │ └── slate.woff2 │ │ │ ├── images │ │ │ ├── logo.png │ │ │ └── navbar.png │ │ │ ├── javascripts │ │ │ ├── all.js │ │ │ └── all_nosearch.js │ │ │ └── stylesheets │ │ │ ├── monokai.css │ │ │ ├── print.css │ │ │ └── screen.css │ └── theme.toml │ └── nathakit_docuapi │ ├── .gitignore │ ├── LICENSE.md │ ├── Makefile │ ├── README.md │ ├── archetypes │ └── default.md │ ├── assets │ ├── javascripts │ │ └── app │ │ │ └── _lang.js │ ├── slate │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fonts │ │ │ ├── AtlasGrotesk-Regular-Web.woff │ │ │ ├── Regular-Semibold.woff │ │ │ ├── slate.eot │ │ │ ├── slate.svg │ │ │ ├── slate.ttf │ │ │ ├── slate.woff │ │ │ └── slate.woff2 │ │ ├── javascripts │ │ │ ├── app │ │ │ │ ├── _custom.js │ │ │ │ ├── _lang.js │ │ │ │ ├── _modernizr-webp_poster.js │ │ │ │ ├── _plyrcontrols.js │ │ │ │ ├── _pupil_sw.js │ │ │ │ ├── _search.js │ │ │ │ ├── _toc.js │ │ │ │ └── _youtube-lazyload.js │ │ │ └── lib │ │ │ │ ├── _energize.js │ │ │ │ ├── _jquery.highlight.js │ │ │ │ ├── _jquery.js │ │ │ │ ├── _jquery.tocify.js │ │ │ │ ├── _jquery_ui.js │ │ │ │ ├── _lazysizes.js │ │ │ │ ├── _lunr.js │ │ │ │ ├── _modernizr-webp.js │ │ │ │ └── _plyr.js │ │ └── stylesheets │ │ │ ├── _fonts.scss │ │ │ ├── _grid.scss │ │ │ ├── _header.scss │ │ │ ├── _icon-font.scss │ │ │ ├── _lazyload.scss │ │ │ ├── _media.scss │ │ │ ├── _normalize.scss │ │ │ ├── _plyr-mixins.scss │ │ │ ├── _plyr-variables.scss │ │ │ ├── _plyr.scss │ │ │ ├── _site.scss │ │ │ ├── _variables.scss │ │ │ ├── monokai.scss │ │ │ ├── print.css.scss │ │ │ └── screen.css.scss │ └── stylesheets │ │ ├── _docuapi.scss │ │ └── monokai.css │ ├── i18n │ └── en.yaml │ ├── layouts │ ├── 404.html │ ├── _default │ │ └── baseof.html │ ├── index.html │ ├── partials │ │ ├── analytics.html │ │ ├── custom-js.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── js.html │ │ ├── service_worker.html │ │ ├── styles.html │ │ └── translations.html │ └── shortcodes │ │ ├── figure-img.html │ │ ├── footnote.html │ │ ├── lqip-img.html │ │ ├── video-webm.html │ │ ├── video-youtube.html │ │ └── webp-img.html │ ├── old_slate │ ├── fonts │ │ ├── AtlasGrotesk-Regular-Web.woff │ │ ├── Regular-Semibold.woff │ │ ├── slate.eot │ │ ├── slate.svg │ │ ├── slate.ttf │ │ ├── slate.woff │ │ └── slate.woff2 │ ├── javascripts │ │ ├── all.js │ │ └── all_nosearch.js │ └── stylesheets │ │ ├── monokai.css │ │ └── print.css │ ├── requirements.txt │ ├── static │ └── slate │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fonts │ │ ├── AtlasGrotesk-Regular-Web.woff │ │ ├── Regular-Semibold.woff │ │ ├── slate.eot │ │ ├── slate.svg │ │ ├── slate.ttf │ │ ├── slate.woff │ │ └── slate.woff2 │ │ ├── javascripts │ │ ├── app │ │ │ ├── _custom.js │ │ │ ├── _lang.js │ │ │ ├── _modernizr-webp_poster.js │ │ │ ├── _plyrcontrols.js │ │ │ ├── _pupil_sw.js │ │ │ ├── _search.js │ │ │ ├── _toc.js │ │ │ └── _youtube-lazyload.js │ │ └── lib │ │ │ ├── _energize.js │ │ │ ├── _jquery.highlight.js │ │ │ ├── _jquery.js │ │ │ ├── _jquery.tocify.js │ │ │ ├── _jquery_ui.js │ │ │ ├── _lazysizes.js │ │ │ ├── _lunr.js │ │ │ ├── _modernizr-webp.js │ │ │ └── _plyr.js │ │ └── stylesheets │ │ ├── _fonts.scss │ │ ├── _grid.scss │ │ ├── _header.scss │ │ ├── _icon-font.scss │ │ ├── _lazyload.scss │ │ ├── _media.scss │ │ ├── _normalize.scss │ │ ├── _plyr-mixins.scss │ │ ├── _plyr-variables.scss │ │ ├── _plyr.scss │ │ ├── _site.scss │ │ ├── _variables.scss │ │ ├── monokai.scss │ │ ├── print.css.scss │ │ └── screen.css.scss │ └── theme.toml └── src ├── build.sh ├── clean.sh ├── comment-recording.import.scm ├── comment-recording.scm ├── file-repo.scm ├── install_chicken_eggs.sh ├── listicles.import.scm ├── listicles.scm ├── masufiles.import.scm ├── masufiles.scm ├── masurequests.import.scm ├── masurequests.scm ├── masutils.import.scm ├── masutils.scm ├── pathname-expand.import.scm ├── pathname-expand.scm ├── pc.scm ├── private_comments.scm └── tests ├── commentless_file.txt ├── test_client ├── test_server └── test_suite_management.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | docs/** linguist-documentation 2 | site/** linguist-documentation 3 | *.html linguist-documentation 4 | *.js linguist-documentation 5 | *.css linguist-documentation 6 | *.scss linguist-documentation 7 | *.go linguist-vendored 8 | Makefile linguist-vendored 9 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | schedule: 9 | - cron: "43 7 * * 0" 10 | concurrency: 11 | group: ${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | test: 16 | strategy: 17 | matrix: 18 | runs-on: [ macos-latest ] 19 | runs-on: ${{ matrix.runs-on }} 20 | steps: 21 | - uses: actions/checkout@v3 22 | - if: matrix.runs-on == 'macos-latest' 23 | run: "cd ./src && ./build.sh" 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | tags 3 | site/public 4 | src/private_comments 5 | src/pc 6 | src/*.tgz 7 | src/*.so 8 | src/*.o 9 | src/*.link 10 | .DS_Store 11 | src/*.tgz 12 | src/tests/pc_test_comments_dir/* 13 | bin/* 14 | -------------------------------------------------------------------------------- /BACKING_UP_DATA.md: -------------------------------------------------------------------------------- 1 | ## Backing Up Your Data 2 | 3 | By default, your private comments are stored in the `PRIVATE_COMMENTS_DIR`. This defaults to `~/.config/private_comments`. They are _not_ uploaded anywhere else. 4 | 5 | As with any other important data, if you don't want to risk loosing it, you should back it up. 6 | 7 | ### Easy Mode 8 | The simplest way is to set `PRIVATE_COMMENTS_DIR` to point to a folder that can be automatically synced to the cloud, or a backup drive. For example, within a folder managed by Dropbox, Google Drive, etc. If your hard drive is automatically backed up, just make sure that the `PRIVATE_COMMENTS_DIR` is being included in your backups. 9 | 10 | ### Backing Up With Git 11 | 12 | A slightly more complicated option is to leverage `post-commit` hooks. Every git repo you leave comments on, has a corresponding repo under the `PRIVATE_COMMENTS_DIR`. In each of those you could add a `post-commit` hook that pushed it to a remote repo. For example, a private repo on GitHub. 13 | 14 | This is slightly hampered by the fact that the repo names are typically cryptographic hashes. This is to guarantee that Private Comments doesn't leak metadata about your project if someone _does_ see a comments repo they shouldn't. However, the folder names come from plugins, and the default is to just take the name of the root folder of your project and run it through a SHA 256 hash. This is what the vim and emacs plugins both do. 15 | 16 | Since you know what your project folders are named, you can simply ask sha256 to give you the has of the repo name you're looking for. For example, if you have a "fooberry" repo, you could ask sha256 for its hash with `echo 'my_repo_folder_name' | sha256sum` (on the command line), then find the matching folder name. 17 | 18 | If you're using a remote repo to sync comments between multiple devices you'll want to set up a cron job to sync fresh comments down. Conflicts are _incredibly_ improbable if it's just you, but if your private comments repo is shared with others it could happen. I'd recommend a script that pulls down merges, and deals with conflicts by simply adding the conflicted file. This is just text, not code. You can let the next human who sees it clean up the conflict. 19 | 20 | 21 | ### Warning 22 | Regardless of what you do, be sure to not upload comments about work projects to a location that your bosses would consider violating your NDA. For example, if your company doesn't allow code to be push to the public GitHub servers, then don't push your comments there either. If they don't allow Dropbox on work computers, then that's not an option either. 23 | 24 | While your comments my be innocent and non-offensive, it's almost guaranteed that they'll eventually contain proprietary information about your employers codebase. 25 | 26 | -------------------------------------------------------------------------------- /COMPETITORS.md: -------------------------------------------------------------------------------- 1 | # Private Comment's Competitors 2 | 3 | I'm not the first one to come up with this idea. I do think Private Comments is the best _implementation_ of the idea though. Primarily because of it's cautious handling of repository metadata, the automatic archiving of comments when the line they comment on changes, the possibility of team sharing, and its optional support for encryption. 4 | 5 | But, maybe you want something that works differently. 6 | 7 | Here's what I've found: 8 | 9 | ## Emacs Plugins 10 | * [Emacs Virtual Comments](https://github.com/thanhvg/emacs-virtual-comment#readme) 11 | Same core idea as Private Comments but different implementation. 12 | * [Phantom Inline Comments](https://github.com/blue0513/phantom-inline-comment#readme) 13 | Same core idea as Private Comments but different implementation. 14 | * [Org-remark](https://github.com/nobiot/org-remark#readme) 15 | Enables commenting on a file level, rather than line specific comments. It lets you create your own marginalia. 16 | * [In Place Annotations](https://www.emacswiki.org/emacs/InPlaceAnnotations) 17 | 18 | ## VS Code 19 | * [Codex](https://usecodex.com/) 20 | JetBrains support coming "soon". Comments are in a sidebar instead of inlined, and support markdown and GitHub style "labels", & mentioning team members for notification purposes. Not open-source, appears to be a fledgling pre-revenue company. 21 | 22 | ## Other Editors 23 | Nothing. If it exists, I haven't seen it, and would love it if you'd file an issue, or make a Pull Request to update this page with information about plugins for other editors. 24 | 25 | 26 | -------------------------------------------------------------------------------- /REQUIREMENTS.md: -------------------------------------------------------------------------------- 1 | ## Private Comments Overview 2 | 3 | The primary goal of Private Comments is to allow someone to mark up a document to your heart's content without cluttering up the codebase or worrying about accidentally looking unprofessional, or hurting the feelings of others. Furthermore, editor integration is critical so as to keep comments from being lost or forgotten. 4 | 5 | In order to support the free flow of thought without worry comments the system must be designed such that it works to actively prevent accidental sharing of comments. To this end comments _must never_ be committed to the same repository as the files being commented on. If they are committed to the same repository as the code they can be accidentally shared with others who have the same repository. 6 | 7 | Comments _should_ be shareable with coworkers / team-mates _if_ you desire. 8 | 9 | ## Editor Integration 10 | 11 | It is intended that the primary mechanism of creating and viewing comments is handled via editor plugins. Commenting on code in this system should be as seamless and easy as leaving a comment directly in the source code. 12 | 13 | Your editor should show you only the comments that are _currently_ relevant to the file you are editing. Looking at a historical version of the file should show you the comments from that point in time. 14 | 15 | You should be able to edit comments while viewing a file, but without modifying the file itself. It is up to the plugin creator to decide if this happens inline, like leaving a comment on a line of code in a GitHub PR, in a sidebar, or through some other means. Regardless, "Private Comments" _should_ be visually distinct from normal inline comments. 16 | 17 | It is suggested that plugin creators allow users to easily toggle the display of comments while working. 18 | 19 | 20 | ## Functional Requirements 21 | 22 | * Comments must never be committed to the repo 23 | * Comments must be viewable on multiple machines 24 | * Access to comments must be controllable separately from access to the code. 25 | * The persistence layer must never include the code being commented on 26 | because of potential NDA violations. 27 | * Comments must be tied to a specific version of a specific line of code. 28 | * Comments must persist when the treeish of a commit is changed as the result of a rebase. 29 | * Must not interefere with any existing uses of git tools 30 | * The tool _must_ have no knowledge of the code it is commenting on beyond the associated treeishes of commits. 31 | * The code being commented on must be managed by/in a git repository. 32 | 33 | **Note:** 34 | Future versions may support handling _moved_ code such that your comment moves with the code it's tied to. The initial version will not attempt to address that. 35 | 36 | ## Implementation Details 37 | 38 | Please see [IMPLEMENTATION.md](IMPLEMENTATION.md) for details. 39 | -------------------------------------------------------------------------------- /bin/.folder_keeper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/bin/.folder_keeper -------------------------------------------------------------------------------- /docs/instructional/data_flow.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/docs/instructional/data_flow.monopic -------------------------------------------------------------------------------- /docs/instructional/data_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/docs/instructional/data_flow.png -------------------------------------------------------------------------------- /docs/ui_proposals/vim_proposal.monodraw.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/docs/ui_proposals/vim_proposal.monodraw.monopic -------------------------------------------------------------------------------- /docs/ui_proposals/vim_proposal_creating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/docs/ui_proposals/vim_proposal_creating.png -------------------------------------------------------------------------------- /docs/ui_proposals/vim_proposal_creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/docs/ui_proposals/vim_proposal_creation.png -------------------------------------------------------------------------------- /linux/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 as buildenv 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get -y update \ 6 | && apt-get -y install \ 7 | libchicken-dev \ 8 | chicken-bin \ 9 | build-essential \ 10 | bash 11 | 12 | COPY src/install_chicken_eggs.sh / 13 | RUN chmod a+x /install_chicken_eggs.sh 14 | 15 | RUN /install_chicken_eggs.sh 16 | 17 | VOLUME /src 18 | -------------------------------------------------------------------------------- /linux/make.buildenv.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # Builds a Docker environment for building private_comments. 3 | # Run from the project root: 4 | # ./linux/make.buildenv.sh 5 | 6 | set -x 7 | set -euo pipefail 8 | 9 | docker build -t private_comments_buildenv -f linux/Dockerfile . 10 | -------------------------------------------------------------------------------- /linux/make.release.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Builds a release of private_comments. 4 | # Run from the project root. 5 | 6 | set -x 7 | set -euo pipefail 8 | 9 | BUILD_VERSION="${BUILD_VERSION:-}" 10 | 11 | # Building the build environment, since we don't have a good 12 | # spot to place the buildenv container. 13 | ./linux/make.buildenv.sh 14 | 15 | readonly _script_dir="$(pwd)" 16 | 17 | docker run --interactive --tty \ 18 | -u "$(id -u):$(id -g)" \ 19 | -v "${_script_dir}:/src:rw" \ 20 | private_comments_buildenv \ 21 | /bin/bash -c "cd /src/src && ./build.sh ${BUILD_VERSION}" 22 | -------------------------------------------------------------------------------- /site/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /site/build/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/build/Dockerfile -------------------------------------------------------------------------------- /site/commit_gh_pages_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | hugo 4 | cd public && git add --all && git commit -m "Publishing to gh-pages" && cd .. 5 | 6 | -------------------------------------------------------------------------------- /site/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://masukomi.github.io/private_comments/" 2 | languageCode = "en-us" 3 | title = "Private Comments" 4 | theme = "docuapi" 5 | metaDataFormat = "yaml" 6 | 7 | 8 | # Code higlighting settings 9 | pygmentsCodefences = true 10 | pygmentsCodeFencesGuesSsyntax = false 11 | pygmentsOptions = "" 12 | pygmentsStyle = "monokai" 13 | # The monokai stylesheet is included in the base template. 14 | pygmentsUseClasses = true 15 | 16 | defaultContentLanguage = "en" 17 | 18 | [params] 19 | search = true 20 | 21 | # Configure the language example tabs. 22 | [[params.language_tabs]] 23 | key = "javascript" 24 | name= "JavaScript" 25 | [[params.language_tabs]] 26 | key = "shell" 27 | name = "Shell" 28 | # [[params.language_tabs]] 29 | # key = "go" 30 | # name = "Go" 31 | # [[params.language_tabs]] 32 | # key = "ruby" 33 | # name = "Ruby" 34 | # [[params.language_tabs]] 35 | # key = "python" 36 | # name = "Python" 37 | 38 | #Languages 39 | [languages] 40 | 41 | [languages.en] 42 | languageName = "English" 43 | weight = 2 44 | title = "Private Comments" 45 | 46 | # Left sidebar footer items. Use HTMl or Markdown. 47 | toc_footers = [ 48 | "Hugo Theme by [bep](https://github.com/bep)" 49 | ] 50 | [languages.en.blackfriday] 51 | angledQuotes = false 52 | hrefTargetBlank = true 53 | 54 | 55 | # [languages.nn] 56 | # languageName = "Nynorsk" 57 | # weight = 1 58 | # title = "DocuAPI-døme" 59 | # 60 | # # Left sidebar footer items. Use HTMl or Markdown. 61 | # toc_footers = [ 62 | # "Registrer deg for ein utviklarnøkkel", 63 | # "Dokumentasjonen er driven av [DocuAPI](https://github.com/bep/docuapi)", 64 | # "Hugo Theme av [bep](https://github.com/bep)" 65 | # ] 66 | # 67 | # [languages.nn.blackfriday] 68 | # # Norwegian uses angled quotes 69 | # angledQuotes = true 70 | # hrefTargetBlank = true 71 | 72 | -------------------------------------------------------------------------------- /site/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{define "main"}} 2 | {{ range $elem := .Data.Pages.GroupByParam "section_weight" }} 3 | {{ range $pw := ($elem.Pages.ByParam "page_weight") }} 4 | 5 | {{ .Content }} 6 | {{ end }} 7 | {{ end }} 8 | {{end}} 9 | 10 | -------------------------------------------------------------------------------- /site/layouts/partials/hook_left_sidebar_logo.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/layouts/shortcodes/aside.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /site/layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /site/layouts/shortcodes/success.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /site/layouts/shortcodes/warning.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /site/prep_for_gh_pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf public 4 | git worktree add -B gh-pages public upstream/gh-pages 5 | -------------------------------------------------------------------------------- /site/static/images/logo.idraw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/static/images/logo.idraw -------------------------------------------------------------------------------- /site/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/static/images/logo.png -------------------------------------------------------------------------------- /site/themes/docuapi/.gitignore: -------------------------------------------------------------------------------- 1 | docuapi -------------------------------------------------------------------------------- /site/themes/docuapi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | # Makefile to perform rebuilds after changes to asset files. 5 | # 6 | # n.b. you must install fswatch (OS X: `brew install fswatch`) 7 | # 8 | # To start live live rebuilds, use the following command: 9 | # $ make serve 10 | # 11 | 12 | # TODO: Figure a way to watch recursive 13 | SLATE_DIR := /Users/bep/dev/clone/slate 14 | WATCH_PATHS = ./assets/*.* ./assets/javascripts/*.* ./assets/javascripts/app/*.* 15 | WATCH_PATHS := ${WATCH_PATHS} ./assets/stylesheets/*.* 16 | 17 | build: 18 | go run bundler.go -slate=${SLATE_DIR} 19 | 20 | serve: 21 | @make build 22 | @fswatch -o ${WATCH_PATHS} | xargs -n1 -I{} make build 23 | 24 | release: 25 | git tag -a ${version} -m "Release ${version}" 26 | git push --follow-tags 27 | -------------------------------------------------------------------------------- /site/themes/docuapi/README.md: -------------------------------------------------------------------------------- 1 | **DocuAPI** is a beautiful multilingual API documentation theme for [Hugo](http://gohugo.io/). This theme is built on top of the beautiful work of [Robert Lord](https://github.com/lord) and others on the [Slate](https://github.com/lord/slate) project ([Apache 2 License](https://github.com/lord/slate/blob/master/LICENSE)). 2 | 3 |
4 | 5 | > Visit the [demo site](https://docuapi.netlify.com/). 6 | 7 |
8 | 9 | ![Screenshot DocuAPI Example site](https://raw.githubusercontent.com/bep/docuapi/master/images/screenshot.png) 10 | 11 | ## Use 12 | 13 | See the [exampleSite](https://github.com/bep/docuapi/tree/master/exampleSite) and more specific its site [configuration](https://github.com/bep/docuapi/blob/master/exampleSite/config.toml) for the available options. 14 | 15 | **Most notable:** This theme will use all the (non drafts) pages in the site and build a single-page API documentation. Using `weight` in the page front matter is the easiest way to control page order. 16 | 17 | If you want a different page selection, please provide your own `layouts/index.html` template. 18 | 19 | ## Hooks 20 | 21 | When the fix for [#2549](https://github.com/spf13/hugo/issues/2549) is released we may do this with blocks, but until then you can provide some custom partials: 22 | 23 | * `partials/hook_head_end.html` is inserted right before the `head` end tag. Useful for additional styles etc. 24 | * `partials/hook_body_end.html` which should be clear by its name. 25 | * `partials/hook_left_sidebar_start.html` the start of the left sidebar 26 | * `partials/hook_left_sidebar_end.html` the end of the left sidebar 27 | * `partials/hook_left_sidebar_logo.html` the log `img` source 28 | 29 | The styles and Javascript import are also put in each partial and as such can be overridden if really needed: 30 | 31 | * `partials/styles.html` 32 | * `partials/js.html` 33 | 34 | ## Develop the Theme 35 | 36 | **Note:** In most situations you will be well off just using the theme and maybe in some cases provide your own template(s). Please refer to the [Hugo Documentation](http://gohugo.io/overview/introduction/) for that. 37 | 38 | But you may find styling issues, etc., that you want to fix. Those Pull Requests are warmly welcomed! 39 | 40 | **If you find issues that obviously belongs to [Slate](https://github.com/lord/slate), then please report/fix them there, and we will pull in the latest changes here.** 41 | 42 | This project provides a very custom asset bundler in [bundler.go](https://github.com/bep/docuapi/blob/master/bundler.go) written in Go. 43 | 44 | It depends on `libsass` to build, so you will need `gcc` (a C compiler) to build it for your platform. If that is present, you can try: 45 | 46 | * `go get -u -v .` 47 | * `go run bundler.go` (this will clone Slate to a temp folder) 48 | * Alternative to the above if you already have Slate cloned somewhere: `go run bundler.go -slate=/path/to/Slate` 49 | 50 | All options: 51 | 52 | ```bash 53 | go run bundler.go -h 54 | -minify 55 | apply minification to output Javascript, CSS etc. (default true) 56 | -slate string 57 | the path to the Slate source, if not set it will be cloned from https://github.com/lord/slate.git 58 | ``` 59 | 60 | With `make` and `fswatch` (OSX only, I believe) available, you can get a fairly enjoyable live-reloading development experience for all artifacts by running: 61 | 62 | * `hugo server` in your Hugo site project. 63 | * `make serve` in the theme folder. 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /site/themes/docuapi/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | +++ 3 | -------------------------------------------------------------------------------- /site/themes/docuapi/assets/images/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/assets/images/logo.psd -------------------------------------------------------------------------------- /site/themes/docuapi/assets/stylesheets/_docuapi.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | // The section(s) below are just pulled over from _variables.scss in Slate and adjusted. 4 | 5 | // Make the selected code language a nice blue. 6 | $lang-select-active-bg: $nav-active-bg; 7 | 8 | // Make the main background color slightly lighter than the original. 9 | $main-bg: lighten(#eaf2f6, 2%); 10 | 11 | 12 | // This will be added as the last import to the original Slate screen.css.scs. TOOD(bep) Print? 13 | 14 | .content { 15 | // prevent clearing of higlight divs 16 | &>div.highlight { 17 | clear:none; 18 | } 19 | } 20 | 21 | .toc-footer { 22 | .translations-title { 23 | background-color: $nav-subitem-bg; 24 | padding: 10px $nav-padding; 25 | color: $nav-text; 26 | font-size: 12px; 27 | } 28 | } 29 | 30 | 31 | 32 | // Getting the paths just right for Android and iOS and friends is hard ... 33 | @font-face { 34 | font-family:'slate'; 35 | src:url(/fonts/slate.eot?-syv14m); 36 | src:url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), 37 | url(../fonts/slate.woff2?-syv14m) format("woff2"), 38 | url(../fonts/slate.woff?-syv14m) format("woff"), 39 | url(../fonts/slate.ttf?-syv14m) format("truetype"), 40 | url(../fonts/slate.svg?-syv14m#slate) format("svg"); 41 | font-weight: normal; 42 | font-style: normal; 43 | } -------------------------------------------------------------------------------- /site/themes/docuapi/assets/stylesheets/monokai.css: -------------------------------------------------------------------------------- 1 | .highlight pre { background-color: #272822; } 2 | .highlight .hll { background-color: #272822; } 3 | .highlight .c { color: #75715e } /* Comment */ 4 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 5 | .highlight .k { color: #66d9ef } /* Keyword */ 6 | .highlight .l { color: #ae81ff } /* Literal */ 7 | .highlight .n { color: #f8f8f2 } /* Name */ 8 | .highlight .o { color: #f92672 } /* Operator */ 9 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 10 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 11 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 12 | .highlight .c1 { color: #75715e } /* Comment.Single */ 13 | .highlight .cs { color: #75715e } /* Comment.Special */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 16 | .highlight .kc { color: #66d9ef } /* Keyword.Constant */ 17 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 18 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 19 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 20 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 21 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 22 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 23 | .highlight .m { color: #ae81ff } /* Literal.Number */ 24 | .highlight .s { color: #e6db74 } /* Literal.String */ 25 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 26 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 27 | .highlight .nc { color: #a6e22e } /* Name.Class */ 28 | .highlight .no { color: #66d9ef } /* Name.Constant */ 29 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 30 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 31 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 32 | .highlight .nf { color: #a6e22e } /* Name.Function */ 33 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 34 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 35 | .highlight .nx { color: #a6e22e } /* Name.Other */ 36 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 37 | .highlight .nt { color: #f92672 } /* Name.Tag */ 38 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 39 | .highlight .ow { color: #f92672 } /* Operator.Word */ 40 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 41 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 42 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 47 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ 49 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 50 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 53 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 55 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 61 | 62 | .highlight .gh { } /* Generic Heading & Diff Header */ 63 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 64 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 65 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 66 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/.gitignore: -------------------------------------------------------------------------------- 1 | /public -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/config.toml: -------------------------------------------------------------------------------- 1 | theme = "docuapi" 2 | themesdir = "../.." 3 | languageCode = "en-us" 4 | baseurl = "https://docuapi.netlify.com/" 5 | title = "DocuAPI Example Site" 6 | 7 | # Code higlighting settings 8 | pygmentsCodefences = true 9 | pygmentsCodeFencesGuesSsyntax = false 10 | pygmentsOptions = "" 11 | pygmentsStyle = "monokai" 12 | # The monokai stylesheet is included in the base template. 13 | pygmentsUseClasses = true 14 | 15 | defaultContentLanguage = "en" 16 | 17 | [params] 18 | search = true 19 | 20 | # Configure the language example tabs. 21 | [[params.language_tabs]] 22 | key = "go" 23 | name = "Go" 24 | [[params.language_tabs]] 25 | key = "shell" 26 | name = "Shell" 27 | [[params.language_tabs]] 28 | key = "ruby" 29 | name = "Ruby" 30 | [[params.language_tabs]] 31 | key = "python" 32 | name = "Python" 33 | [[params.language_tabs]] 34 | key = "javascript" 35 | name = "Javascript" 36 | 37 | #Languages 38 | [languages] 39 | 40 | [languages.en] 41 | languageName = "English" 42 | weight = 2 43 | title = "DocuAPI Example Site" 44 | 45 | # Left sidebar footer items. Use HTMl or Markdown. 46 | toc_footers = [ 47 | "Sign Up for a Developer Key", 48 | "Documentation Powered by [DocuAPI](https://github.com/bep/docuapi)", 49 | "Hugo Theme by [bep](https://github.com/bep)" 50 | ] 51 | [languages.en.blackfriday] 52 | angledQuotes = false 53 | hrefTargetBlank = true 54 | 55 | 56 | [languages.nn] 57 | languageName = "Nynorsk" 58 | weight = 1 59 | title = "DocuAPI-døme" 60 | 61 | # Left sidebar footer items. Use HTMl or Markdown. 62 | toc_footers = [ 63 | "Registrer deg for ein utviklarnøkkel", 64 | "Dokumentasjonen er driven av [DocuAPI](https://github.com/bep/docuapi)", 65 | "Hugo Theme av [bep](https://github.com/bep)" 66 | ] 67 | 68 | [languages.nn.blackfriday] 69 | # Norwegian uses angled quotes 70 | angledQuotes = true 71 | hrefTargetBlank = true 72 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/content/errors.md: -------------------------------------------------------------------------------- 1 | --- 2 | weight: 20 3 | title: Errors 4 | 5 | --- 6 | 7 | # Errors 8 | 9 | 10 | 11 | The Kittn API uses the following error codes: 12 | 13 | 14 | Error Code | Meaning 15 | ---------- | ------- 16 | 400 | Bad Request -- Your request sucks 17 | 401 | Unauthorized -- Your API key is wrong 18 | 403 | Forbidden -- The kitten requested is hidden for administrators only 19 | 404 | Not Found -- The specified kitten could not be found 20 | 405 | Method Not Allowed -- You tried to access a kitten with an invalid method 21 | 406 | Not Acceptable -- You requested a format that isn't json 22 | 410 | Gone -- The kitten requested has been removed from our servers 23 | 418 | I'm a teapot 24 | 429 | Too Many Requests -- You're requesting too many kittens! Slow down! 25 | 500 | Internal Server Error -- We had a problem with our server. Try again later. 26 | 503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. 27 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/content/errors.nn.md: -------------------------------------------------------------------------------- 1 | --- 2 | weight: 20 3 | title: Feil 4 | 5 | --- 6 | 7 | # Feil 8 | 9 | 10 | 11 | Kittn-APIet tek i bruk følgjande feilkodar: 12 | 13 | Feilkode | Forklaring 14 | ---------- | ------- 15 | 400 | Bad Request -- Din førespurnad har forbetringspotensiale 16 | 401 | Unauthorized -- Feil API-nøkkel 17 | 403 | Forbidden -- Denne kattungen er berre tilgjengeleg for administratorar 18 | 404 | Not Found -- Denne kattungen vart ikkje funnen 19 | 405 | Method Not Allowed -- Du prøvde å få tak i kattungen på ein snodig og ulovleg måte 20 | 406 | Not Acceptable -- Du bad om eit format som ikkje er JSON 21 | 410 | Gone -- Kattungen har rømt frå serveren. 22 | 418 | I'm a teapot 23 | 429 | Too Many Requests -- Du spør om for mange kattungar, ta det med ro! 24 | 500 | Internal Server Error -- Me har eit problem med serveren. Prøv igjen seinare. 25 | 503 | Service Unavailable -- Me er nede for vedlikehald. Prøv igjen seinare. 26 | 27 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/content/main.md: -------------------------------------------------------------------------------- 1 | --- 2 | weight: 10 3 | title: API Reference 4 | --- 5 | 6 | # Introduction 7 | 8 | Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database. 9 | 10 | We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. 11 | 12 | **This example API documentation page was created with [DocuAPI](https://github.com/bep/docuapi/), a multilingual documentation theme for the static site generator [Hugo](http://gohugo.io/).** 13 | 14 | # Authentication 15 | 16 | > To authorize, use this code: 17 | 18 | ```go 19 | package main 20 | 21 | import "github.com/bep/kittn/auth" 22 | 23 | func main() { 24 | api := auth.Authorize("meowmeowmeow") 25 | 26 | // Just to make it compile 27 | _ = api 28 | } 29 | ``` 30 | 31 | ```ruby 32 | require 'kittn' 33 | 34 | api = Kittn::APIClient.authorize!('meowmeowmeow') 35 | ``` 36 | 37 | ```python 38 | import kittn 39 | 40 | api = kittn.authorize('meowmeowmeow') 41 | ``` 42 | 43 | ```shell 44 | # With shell, you can just pass the correct header with each request 45 | curl "api_endpoint_here" 46 | -H "Authorization: meowmeowmeow" 47 | ``` 48 | 49 | ```javascript 50 | const kittn = require('kittn'); 51 | 52 | let api = kittn.authorize('meowmeowmeow'); 53 | ``` 54 | 55 | > Make sure to replace `meowmeowmeow` with your API key. 56 | 57 | Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers). 58 | 59 | Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following: 60 | 61 | `Authorization: meowmeowmeow` 62 | 63 | 66 | 67 | # Kittens 68 | 69 | ## Get All Kittens 70 | 71 | ```go 72 | package main 73 | 74 | import "github.com/bep/kittn/auth" 75 | 76 | func main() { 77 | api := auth.Authorize("meowmeowmeow") 78 | 79 | _ = api.GetKittens() 80 | } 81 | ``` 82 | 83 | ```ruby 84 | require 'kittn' 85 | 86 | api = Kittn::APIClient.authorize!('meowmeowmeow') 87 | api.kittens.get 88 | ``` 89 | 90 | ```python 91 | import kittn 92 | 93 | api = kittn.authorize('meowmeowmeow') 94 | api.kittens.get() 95 | ``` 96 | 97 | ```shell 98 | curl "http://example.com/api/kittens" 99 | -H "Authorization: meowmeowmeow" 100 | ``` 101 | 102 | ```javascript 103 | const kittn = require('kittn'); 104 | 105 | let api = kittn.authorize('meowmeowmeow'); 106 | let kittens = api.kittens.get(); 107 | ``` 108 | 109 | > The above command returns JSON structured like this: 110 | 111 | ```json 112 | [ 113 | { 114 | "id": 1, 115 | "name": "Fluffums", 116 | "breed": "calico", 117 | "fluffiness": 6, 118 | "cuteness": 7 119 | }, 120 | { 121 | "id": 2, 122 | "name": "Max", 123 | "breed": "unknown", 124 | "fluffiness": 5, 125 | "cuteness": 10 126 | } 127 | ] 128 | ``` 129 | 130 | This endpoint retrieves all kittens. 131 | 132 | ### HTTP Request 133 | 134 | `GET http://example.com/api/kittens` 135 | 136 | ### Query Parameters 137 | 138 | Parameter | Default | Description 139 | --------- | ------- | ----------- 140 | include_cats | false | If set to true, the result will also include cats. 141 | available | true | If set to false, the result will include kittens that have already been adopted. 142 | 143 | 146 | 147 | ## Get a Specific Kitten 148 | 149 | ```go 150 | package main 151 | 152 | import "github.com/bep/kittn/auth" 153 | 154 | func main() { 155 | api := auth.Authorize("meowmeowmeow") 156 | 157 | _ = api.GetKitten(2) 158 | } 159 | ``` 160 | 161 | ```ruby 162 | require 'kittn' 163 | 164 | api = Kittn::APIClient.authorize!('meowmeowmeow') 165 | api.kittens.get(2) 166 | ``` 167 | 168 | ```python 169 | import kittn 170 | 171 | api = kittn.authorize('meowmeowmeow') 172 | api.kittens.get(2) 173 | ``` 174 | 175 | ```shell 176 | curl "http://example.com/api/kittens/2" 177 | -H "Authorization: meowmeowmeow" 178 | ``` 179 | 180 | ```javascript 181 | const kittn = require('kittn'); 182 | 183 | let api = kittn.authorize('meowmeowmeow'); 184 | let max = api.kittens.get(2); 185 | ``` 186 | 187 | > The above command returns JSON structured like this: 188 | 189 | ```json 190 | { 191 | "id": 2, 192 | "name": "Max", 193 | "breed": "unknown", 194 | "fluffiness": 5, 195 | "cuteness": 10 196 | } 197 | ``` 198 | 199 | This endpoint retrieves a specific kitten. 200 | 201 | 202 | 203 | ### HTTP Request 204 | 205 | `GET http://example.com/kittens/` 206 | 207 | ### URL Parameters 208 | 209 | Parameter | Description 210 | --------- | ----------- 211 | ID | The ID of the kitten to retrieve 212 | 213 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/content/main.nn.md: -------------------------------------------------------------------------------- 1 | --- 2 | weight: 10 3 | title: API 4 | --- 5 | 6 | # Innleiing 7 | 8 | Velkomen skal du vere til Kittn API! Du kan bruke vårt API til å kalle våre Kittn endepunkt. Her kan du hente ut ymse informasjon om kattar, kattungar og ulike rasar frå vår database. 9 | 10 | Her finn du kodedøme i Shell, Ruby, Python og Go! Du ser desse døma i det mørke feltet til høgre på skjermen -- og du kan byta programmeringsspråk ved å klikke på menyen oppe til høgre. 11 | 12 | **Denne API-dokumentasjonen vart laga med [DocuAPI](https://github.com/bep/docuapi/), eit tema for den statiske nettstadsmakaren [Hugo](http://gohugo.io/).** 13 | 14 | # Autentisering 15 | 16 | > For å autentisere ein brukar, bruk denne koden: 17 | 18 | ```go 19 | package main 20 | 21 | import "github.com/bep/kittn/auth" 22 | 23 | func main() { 24 | api := auth.Authorize("meowmeowmeow") 25 | 26 | // Just to make it compile 27 | _ = api 28 | } 29 | ``` 30 | 31 | ```ruby 32 | require 'kittn' 33 | 34 | api = Kittn::APIClient.authorize!('meowmeowmeow') 35 | ``` 36 | 37 | ```python 38 | import kittn 39 | 40 | api = kittn.authorize('meowmeowmeow') 41 | ``` 42 | 43 | ```shell 44 | # With shell, you can just pass the correct header with each request 45 | curl "api_endpoint_here" 46 | -H "Authorization: meowmeowmeow" 47 | ``` 48 | 49 | ```javascript 50 | const kittn = require('kittn'); 51 | 52 | let api = kittn.authorize('meowmeowmeow'); 53 | ``` 54 | 55 | > Gjer vel og erstatt `meowmeowmeow` med din eigen API-nøkkel. 56 | 57 | Kittn tek i bruk API-nøklar for å gi tilgang til APIet. Du kan kan registrere deg for å få ein slik nøkkel på vår [utviklarportal](http://example.com/developers). 58 | 59 | Kittn forventar at API-nøkkelen er med i alle API-førespurnader til serveren i ein header som ser slik ut: 60 | 61 | `Authorization: meowmeowmeow` 62 | 63 | 65 | 66 | # Kattungar 67 | 68 | ## Hent alle kattungane 69 | 70 | ```go 71 | package main 72 | 73 | import "github.com/bep/kittn/auth" 74 | 75 | func main() { 76 | api := auth.Authorize("meowmeowmeow") 77 | 78 | _ = api.GetKittens() 79 | } 80 | ``` 81 | 82 | ```ruby 83 | require 'kittn' 84 | 85 | api = Kittn::APIClient.authorize!('meowmeowmeow') 86 | api.kittens.get 87 | ``` 88 | 89 | ```python 90 | import kittn 91 | 92 | api = kittn.authorize('meowmeowmeow') 93 | api.kittens.get() 94 | ``` 95 | 96 | ```shell 97 | curl "http://example.com/api/kittens" 98 | -H "Authorization: meowmeowmeow" 99 | ``` 100 | 101 | ```javascript 102 | const kittn = require('kittn'); 103 | 104 | let api = kittn.authorize('meowmeowmeow'); 105 | let kittens = api.kittens.get(); 106 | ``` 107 | 108 | > Programmet over gir ein JSON-struktur som ser slik ut: 109 | 110 | ```json 111 | [ 112 | { 113 | "id": 1, 114 | "name": "Fluffums", 115 | "breed": "calico", 116 | "fluffiness": 6, 117 | "cuteness": 7 118 | }, 119 | { 120 | "id": 2, 121 | "name": "Max", 122 | "breed": "unknown", 123 | "fluffiness": 5, 124 | "cuteness": 10 125 | } 126 | ] 127 | ``` 128 | 129 | Dette endepunktet leverer alle kattungar. 130 | 131 | ### HTTP-førespurnad 132 | 133 | `GET http://example.com/api/kittens` 134 | 135 | ### Query-parametrar 136 | 137 | Parameter | Standardverdi | Skildring 138 | --------- | ------- | ----------- 139 | include_cats | false | Set til true for å få alle kattar. 140 | available | true | Set til false for å ta med kattar som allereie er blitt adoptert vekk. 141 | 142 | 145 | 146 | ## Hent éin kattunge 147 | 148 | ```go 149 | package main 150 | 151 | import "github.com/bep/kittn/auth" 152 | 153 | func main() { 154 | api := auth.Authorize("meowmeowmeow") 155 | 156 | _ = api.GetKitten(2) 157 | } 158 | ``` 159 | 160 | ```ruby 161 | require 'kittn' 162 | 163 | api = Kittn::APIClient.authorize!('meowmeowmeow') 164 | api.kittens.get(2) 165 | ``` 166 | 167 | ```python 168 | import kittn 169 | 170 | api = kittn.authorize('meowmeowmeow') 171 | api.kittens.get(2) 172 | ``` 173 | 174 | ```shell 175 | curl "http://example.com/api/kittens/2" 176 | -H "Authorization: meowmeowmeow" 177 | ``` 178 | 179 | ```javascript 180 | const kittn = require('kittn'); 181 | 182 | let api = kittn.authorize('meowmeowmeow'); 183 | let max = api.kittens.get(2); 184 | ``` 185 | 186 | > Programmet over gir ein JSON-struktur som ser slik ut: 187 | 188 | ```json 189 | { 190 | "id": 2, 191 | "name": "Max", 192 | "breed": "unknown", 193 | "fluffiness": 5, 194 | "cuteness": 10 195 | } 196 | ``` 197 | 198 | Dette endepunktet hentar ut éin spesifikk kattunge. 199 | 200 | 201 | 202 | ### HTTP-førespurnad 203 | 204 | `GET http://example.com/kittens/` 205 | 206 | ### URL-parametrar 207 | 208 | Parameter | Skildring 209 | --------- | ----------- 210 | ID | IDen til kattungen du ynskjer å hente 211 | 212 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/layouts/partials/hook_head_end.html: -------------------------------------------------------------------------------- 1 | {{ with getenv "ADD_GA" }} 2 | 12 | {{ end }} -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/layouts/partials/hook_left_sidebar_end.html: -------------------------------------------------------------------------------- 1 | {{ if getenv "REPOSITORY_URL" -}} 2 |
3 | 4 | 5 | 6 |
7 | {{ end }} 8 | -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/exampleSite/static/.gitkeep -------------------------------------------------------------------------------- /site/themes/docuapi/exampleSite/static/_headers: -------------------------------------------------------------------------------- 1 | /* 2 | X-Frame-Options: DENY 3 | X-XSS-Protection: 1; mode=block 4 | 5 | -------------------------------------------------------------------------------- /site/themes/docuapi/i18n/en.yaml: -------------------------------------------------------------------------------- 1 | - id: translations 2 | translation: 3 | one: "Translation" 4 | other: "Translations" 5 | 6 | # Search label 7 | - id: search 8 | translation: "Search" 9 | -------------------------------------------------------------------------------- /site/themes/docuapi/i18n/nn.yaml: -------------------------------------------------------------------------------- 1 | - id: translations 2 | translation: 3 | one: "Omsetjing" 4 | other: "Omsetjingar" 5 | 6 | # Search label 7 | - id: search 8 | translation: "Søk" 9 | -------------------------------------------------------------------------------- /site/themes/docuapi/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/images/screenshot.png -------------------------------------------------------------------------------- /site/themes/docuapi/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/images/tn.png -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/404.html: -------------------------------------------------------------------------------- 1 | {{define "main"}} 2 |

Page Not Found!

3 | {{end}} -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ .Title }} 8 | {{ partial "styles.html" . }} 9 | {{ partial "js.html" . }} 10 | {{ partial "hook_head_end.html" . }} 11 | 12 | 13 | 14 | 15 | NAV 16 | 17 | 18 | 19 |
20 | {{ partial "hook_left_sidebar_start.html" . }} 21 | {{ partial "hook_left_sidebar_logo.html" . }} 22 | {{ with .Site.Params.language_tabs }} 23 |
24 | {{ range . }} 25 | {{ .name }} 26 | {{ end }} 27 |
28 | {{ end }} 29 | {{ if .Site.Params.search }} 30 | 33 |
    34 | {{ end }} 35 |
    36 |
    37 | {{ if .IsTranslated }} 38 | 42 | {{ end }} 43 | {{ with .Site.Params.toc_footers }} 44 | 49 | {{ end}} 50 | {{ partial "hook_left_sidebar_end.html" . }} 51 |
    52 |
    53 |
    54 |
    55 | {{block "main" .}}This is the main content.{{end}} 56 |
    57 |
    58 | {{ with .Site.Params.language_tabs }} 59 |
    60 | {{ range . }} 61 | {{ .name }} 62 | {{ end }} 63 |
    64 | {{ end }} 65 |
    66 |
    67 | {{ partial "hook_body_end.html" . }} 68 | 69 | 70 | -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{define "main"}} 2 | {{ range .Data.Pages }} 3 | {{ .Content }} 4 | {{ end }} 5 | {{end}} -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/hook_body_end.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/layouts/partials/hook_body_end.html -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/hook_head_end.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/layouts/partials/hook_head_end.html -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/hook_left_sidebar_end.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/layouts/partials/hook_left_sidebar_end.html -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/hook_left_sidebar_logo.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/hook_left_sidebar_start.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/layouts/partials/hook_left_sidebar_start.html -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/js.html: -------------------------------------------------------------------------------- 1 | {{ if .Param "search" }} 2 | 3 | {{ else }} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /site/themes/docuapi/layouts/partials/translations.html: -------------------------------------------------------------------------------- 1 | {{ if .IsTranslated }} 2 | 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /site/themes/docuapi/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/images/logo.png -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/fonts/slate.eot -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/fonts/slate.ttf -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/fonts/slate.woff -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/fonts/slate.woff2 -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/images/logo.png -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/docuapi/static/slate/images/navbar.png -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/stylesheets/monokai.css: -------------------------------------------------------------------------------- 1 | .highlight pre{background-color:#272822}.highlight .hll{background-color:#272822}.highlight .c{color:#75715e}.highlight .err{color:#960050;background-color:#1e0010}.highlight .k{color:#66d9ef}.highlight .l{color:#ae81ff}.highlight .n{color:#f8f8f2}.highlight .o{color:#f92672}.highlight .p{color:#f8f8f2}.highlight .cm{color:#75715e}.highlight .cp{color:#75715e}.highlight .c1{color:#75715e}.highlight .cs{color:#75715e}.highlight .ge{font-style:italic}.highlight .gs{font-weight:bold}.highlight .kc{color:#66d9ef}.highlight .kd{color:#66d9ef}.highlight .kn{color:#f92672}.highlight .kp{color:#66d9ef}.highlight .kr{color:#66d9ef}.highlight .kt{color:#66d9ef}.highlight .ld{color:#e6db74}.highlight .m{color:#ae81ff}.highlight .s{color:#e6db74}.highlight .na{color:#a6e22e}.highlight .nb{color:#f8f8f2}.highlight .nc{color:#a6e22e}.highlight .no{color:#66d9ef}.highlight .nd{color:#a6e22e}.highlight .ni{color:#f8f8f2}.highlight .ne{color:#a6e22e}.highlight .nf{color:#a6e22e}.highlight .nl{color:#f8f8f2}.highlight .nn{color:#f8f8f2}.highlight .nx{color:#a6e22e}.highlight .py{color:#f8f8f2}.highlight .nt{color:#f92672}.highlight .nv{color:#f8f8f2}.highlight .ow{color:#f92672}.highlight .w{color:#f8f8f2}.highlight .mf{color:#ae81ff}.highlight .mh{color:#ae81ff}.highlight .mi{color:#ae81ff}.highlight .mo{color:#ae81ff}.highlight .sb{color:#e6db74}.highlight .sc{color:#e6db74}.highlight .sd{color:#e6db74}.highlight .s2{color:#e6db74}.highlight .se{color:#ae81ff}.highlight .sh{color:#e6db74}.highlight .si{color:#e6db74}.highlight .sx{color:#e6db74}.highlight .sr{color:#e6db74}.highlight .s1{color:#e6db74}.highlight .ss{color:#e6db74}.highlight .bp{color:#f8f8f2}.highlight .vc{color:#f8f8f2}.highlight .vg{color:#f8f8f2}.highlight .vi{color:#f8f8f2}.highlight .il{color:#ae81ff}.highlight .gu{color:#75715e}.highlight .gd{color:#f92672}.highlight .gi{color:#a6e22e} 2 | -------------------------------------------------------------------------------- /site/themes/docuapi/static/slate/stylesheets/print.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.content h1,.content h2,.content h3,.content h4,body{font-family:"Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;font-size:13px}.content h1,.content h2,.content h3,.content h4{font-weight:bold}.content pre,.content code{font-family:Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;font-size:12px;line-height:1.5}.content pre,.content code{word-break:break-all;hyphens:auto}@font-face{font-family:'slate';src:font-url("slate.eot?-syv14m");src:font-url("slate.eot?#iefix-syv14m") format("embedded-opentype"),font-url("slate.woff2?-syv14m") format("woff2"),font-url("slate.woff?-syv14m") format("woff"),font-url("slate.ttf?-syv14m") format("truetype"),font-url("slate.svg?-syv14m#slate") format("svg");font-weight:normal;font-style:normal}.content aside.warning:before,.content aside.notice:before,.content aside.success:before{font-family:'slate';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1}.content aside.warning:before{content:"\e600"}.content aside.notice:before{content:"\e602"}.content aside.success:before{content:"\e606"}.tocify,.toc-footer,.lang-selector,.search,#nav-button{display:none}.tocify-wrapper>img{margin:0 auto;display:block}.content{font-size:12px}.content pre,.content code{border:1px solid #999;border-radius:5px;font-size:0.8em}.content pre code{border:0}.content pre{padding:1.3em}.content code{padding:0.2em}.content table{border:1px solid #999}.content table tr{border-bottom:1px solid #999}.content table td,.content table th{padding:0.7em}.content p{line-height:1.5}.content a{text-decoration:none;color:#000}.content h1{font-size:2.5em;padding-top:0.5em;padding-bottom:0.5em;margin-top:1em;margin-bottom:21px;border:2px solid #ccc;border-width:2px 0;text-align:center}.content h2{font-size:1.8em;margin-top:2em;border-top:2px solid #ccc;padding-top:0.8em}.content h1+h2,.content h1+div+h2{border-top:none;padding-top:0;margin-top:0}.content h3,.content h4{font-size:0.8em;margin-top:1.5em;margin-bottom:0.8em;text-transform:uppercase}.content h5,.content h6{text-transform:uppercase}.content aside{padding:1em;border:1px solid #ccc;border-radius:5px;margin-top:1.5em;margin-bottom:1.5em;line-height:1.6}.content aside:before{vertical-align:middle;padding-right:0.5em;font-size:14px} 2 | -------------------------------------------------------------------------------- /site/themes/docuapi/theme.toml: -------------------------------------------------------------------------------- 1 | name = "DocuAPI" 2 | license = "Apache-2.0" 3 | licenselink = "https://github.com/bep/docuapi/blob/master/LICENSE.md" 4 | description = "Beautiful documentation for your API." 5 | homepage = "https://github.com/bep/docuapi" 6 | tags = ["Documentation", "API", "Docs", "Responsive", "Multilingual"] 7 | features = ["Documentation", "Multilingual"] 8 | min_version = 0.17 9 | 10 | [author] 11 | name = "Bjørn Erik Pedersen" 12 | homepage = "http://bep.is" 13 | 14 | [original] 15 | name = "Slate" 16 | homepage = "https://github.com/lord/slate" 17 | repo = "https://github.com/lord/slate" 18 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/.gitignore: -------------------------------------------------------------------------------- 1 | *.min.css 2 | *.min.js -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 4 | # Makefile to perform rebuilds after changes to asset files. 5 | # 6 | # n.b. you must install fswatch (OS X: `brew install fswatch`) 7 | # 8 | # To start live live rebuilds, use the following command: 9 | # $ make serve 10 | # 11 | 12 | # TODO: Figure a way to watch recursive 13 | SLATE_DIR := /Users/bep/dev/clone/slate 14 | WATCH_PATHS = ./assets/*.* ./assets/javascripts/*.* ./assets/javascripts/app/*.* 15 | WATCH_PATHS := ${WATCH_PATHS} ./assets/stylesheets/*.* 16 | 17 | build: 18 | go run bundler.go -slate=${SLATE_DIR} 19 | 20 | serve: 21 | @make build 22 | @fswatch -o ${WATCH_PATHS} | xargs -n1 -I{} make build 23 | 24 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/README.md: -------------------------------------------------------------------------------- 1 | **DocuAPI** is a beautiful multilingual API documentation theme for [Hugo](http://gohugo.io/). This theme is built on top of the beautiful work of [Robert Lord](https://github.com/lord) and others on the [Slate](https://github.com/lord/slate) project ([Apache 2 License](https://github.com/lord/slate/blob/master/LICENSE)). 2 | 3 |
    4 | 5 | > Visit the [demo site](http://docuapi.com/). 6 | 7 |
    8 | 9 | [![CircleCI](https://circleci.com/gh/bep/docuapi.svg?style=svg)](https://circleci.com/gh/bep/docuapi) 10 | 11 | ![Screenshot DocuAPI Example site](https://raw.githubusercontent.com/bep/docuapi/master/images/screenshot.png) 12 | 13 | ## Use 14 | 15 | See the [exampleSite](https://github.com/bep/docuapi/tree/master/exampleSite) and more specific its site [configuration](https://github.com/bep/docuapi/blob/master/exampleSite/config.toml) for the available options. 16 | 17 | **Note that this theme needs Pygments installed to render code samples. See [pygments.org](http://pygments.org/)** 18 | 19 | **Most notable:** This theme will use all the (non drafts) pages in the site and build a single-page API documentation. Using `weight` in the page front matter is the easiest way to control page order. 20 | 21 | If you want a different page selection, please provide your own `layouts/index.html` template. 22 | 23 | ## Hooks 24 | 25 | When the fix for [#2549](https://github.com/spf13/hugo/issues/2549) is released we may do this with blocks, but until then you can provide some custom partials: 26 | 27 | * `partials/hook_head_end.html` is inserted right before the `head` end tag. Useful for additional styles etc. 28 | * `partials/hook_body_end.html` which should be clear by its name. 29 | 30 | The styles and Javascript import are also put in each partial and as such can be overridden if really needed: 31 | 32 | * `partials/styles.html` 33 | * `partials/js.html` 34 | 35 | ## Develop the Theme 36 | 37 | **Note:** In most situations you will be well off just using the theme and maybe in some cases provide your own template(s). Please refer to the [Hugo Documentation](http://gohugo.io/overview/introduction/) for that. 38 | 39 | But you may find styling issues, etc., that you want to fix. Those Pull Requests are warmly welcomed! 40 | 41 | **If you find issues that obviously belongs to [Slate](https://github.com/lord/slate), then please report/fix them there, and we will pull in the latest changes here.** 42 | 43 | This project provides a very custom asset bundler in [bundler.go](https://github.com/bep/docuapi/blob/master/bundler.go) written in Go. 44 | 45 | It depends on `libsass` to build, so you will need `gcc` (a C compiler) to build it for your platform. If that is present, you can try: 46 | 47 | * `go get -u -v .` 48 | * `go run bundler.go` (this will clone Slate to a temp folder) 49 | * Alternative to the above if you already have Slate cloned somewhere: `go run bundler.go -slate=/path/to/Slate` 50 | 51 | All options: 52 | 53 | ```bash 54 | go run bundler.go -h 55 | -minify 56 | apply minification to output Javascript, CSS etc. (default true) 57 | -slate string 58 | the path to the Slate source, if not set it will be cloned from https://github.com/lord/slate.git 59 | ``` 60 | 61 | With `make` and `fswatch` (OSX only, I believe) available, you can get a fairly enjoyable live-reloading development experience for all artifacts by running: 62 | 63 | * `hugo server` in your Hugo site project. 64 | * `make serve` in the theme folder. 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | section_weight = "" 3 | page_weight = "" 4 | +++ -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008-2013 Concur Technologies, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | not use this file except in compliance with the License. You may obtain 5 | a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | License for the specific language governing permissions and limitations 13 | under the License. -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/README.md: -------------------------------------------------------------------------------- 1 | # slate 2 | 3 | Minimal version of slate without middleman. Just js, styles, and fonts. 4 | 5 | See master branch for original readme. 6 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/AtlasGrotesk-Regular-Web.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/AtlasGrotesk-Regular-Web.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/Regular-Semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/Regular-Semibold.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/slate.eot -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/slate.ttf -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/slate.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/assets/slate/fonts/slate.woff2 -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | // on document load - version selector should show current version 4 | $("#version-selector").val(window.location.pathname.replace(/\//g,'')); 5 | 6 | $(".anchor").click( function() { 7 | event.preventDefault(); 8 | history.replaceState(null, null, $(this).attr("href")); 9 | $(window).scrollTop($("div[data-unique='"+$(this).attr("name")+"']").offset().top - 49); 10 | }) 11 | 12 | $("#version-selector").change(function() { 13 | var value = $(this).val(); 14 | var cannonical_url = "http://docs.pupil-labs.com/"; 15 | var hash = window.location.hash; 16 | window.location.href = cannonical_url+value+hash; 17 | }); 18 | 19 | }); 20 | 21 | document.addEventListener("DOMContentLoaded", function() { 22 | 23 | var elements = document.getElementsByClassName('github-link'); 24 | 25 | for (var i = 0; i < elements.length; i++) { 26 | var _e = elements[i]; 27 | var section_link = _e.getAttribute('data-github'); 28 | 29 | while (_e.nextElementSibling && !_e.nextElementSibling.matches('.github-link')) { 30 | if (_e.matches("h1") || _e.matches("h2") || _e.matches("h3")){ 31 | // the h1,h2,h3 nodes have text and two links as children 32 | // child_nodes[1] is the first link (hash link to the section) 33 | // child_nodes[2] or lastChild is the external link to github 34 | var child_nodes = _e.childNodes; 35 | var heading_hash = child_nodes[1].getAttribute('href'); 36 | var hash_link = section_link + heading_hash; 37 | var github_edit_link = _e.lastChild; 38 | github_edit_link.setAttribute('href',hash_link); 39 | github_edit_link.insertAdjacentHTML('afterbegin','mode_edit'); 40 | } 41 | _e = _e.nextElementSibling; 42 | } 43 | 44 | } 45 | 46 | }); 47 | 48 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_modernizr-webp_poster.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function(event) { 2 | 'use-strict'; 3 | Modernizr.on('webp', function (result) { 4 | // Get all the video tags in the DOM 5 | var video = document.getElementsByTagName('video'); 6 | // Iterate through the list and get he poster attribute 7 | for (var i=0; i < video.length; i++) { 8 | var poster_url = video[i].getAttribute('poster'); 9 | 10 | if (!result) { 11 | // if browser check fails then replace webp with jpg 12 | var jpg = poster_url.replace(/[.]webp/g,".jpg"); 13 | video[i].setAttribute('poster', jpg) 14 | } 15 | } 16 | }) 17 | }); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_plyrcontrols.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // This is the bare minimum JavaScript. You can opt to pass no arguments to setup. 3 | // e.g. just plyr.setup(); and leave it at that if you have no need for events 4 | var instances = plyr.setup({ 5 | // Output to console 6 | controls: ["play-large", "fullscreen"] 7 | }); 8 | 9 | })(); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_pupil_sw.js: -------------------------------------------------------------------------------- 1 | 'use-strict' 2 | 3 | /* A version number is useful when updating the worker logic, 4 | allowing you to remove outdated cache entries during the update. 5 | */ 6 | 7 | var gitVersion = 'c63de0b'; 8 | var pupil_docs_cache = gitVersion+"::docs-cache"; 9 | 10 | /* These resources will be downloaded and cached by the service worker 11 | during the installation process. If any resource fails to be downloaded, 12 | then the service worker won't be installed either. 13 | */ 14 | var urlsToCache = [ 15 | // '/' 16 | '/slate/stylesheets/screen.min.css', 17 | '/slate/javascripts/all.min.js', 18 | '/slate/javascripts/plyr.min.js', 19 | '/slate/javascripts/yt-lazyload.min.js', 20 | '/videos/', 21 | '/images/' 22 | ]; 23 | 24 | // console.log('WORKER: Executing...'); 25 | 26 | self.addEventListener('install', function(event) { 27 | // console.log('WORKER: Installing...'+gitVersion) 28 | /* Using event.waitUntil(p) blocks the installation process on the provided 29 | promise. If the promise is rejected, the service worker won't be installed. 30 | */ 31 | event.waitUntil( 32 | caches.open(pupil_docs_cache) 33 | .then(function(cache) { 34 | // console.log('Opened cache'); 35 | return cache.addAll(urlsToCache); 36 | }) 37 | // .then(function() { 38 | // console.log('WORKER: Install completed'); 39 | // }) 40 | ); 41 | }); 42 | 43 | /* The fetch event fires whenever a page controlled by this service worker requests 44 | a resource. This isn't limited to `fetch` or even XMLHttpRequest. Instead, it 45 | comprehends even the request for the HTML page on first load, as well as JS and 46 | CSS resources, fonts, any images, etc. 47 | */ 48 | 49 | self.addEventListener('fetch', function(event) { 50 | // console.log('WORKER: Fetch event in progress...'); 51 | event.respondWith( 52 | caches.match(event.request) 53 | .then(function(response) { 54 | // Cache hit - return response 55 | if (response) { 56 | return response; 57 | } 58 | 59 | /* IMPORTANT: Clone the request. A request is a stream and 60 | can only be consumed once. Since we are consuming this 61 | once by cache and once by the browser for fetch, we need 62 | to clone the response. 63 | */ 64 | var fetchRequest = event.request.clone(); 65 | 66 | return fetch(fetchRequest).then( 67 | function(response) { 68 | // Check if we received a valid response 69 | if(!response || response.status !== 200 || response.type !== 'basic') { 70 | return response; 71 | } 72 | 73 | /* IMPORTANT: Clone the response. A response is a stream 74 | and because we want the browser to consume the response 75 | as well as the cache consuming the response, we need 76 | to clone it so we have two streams. 77 | */ 78 | var responseToCache = response.clone(); 79 | 80 | // console.log('WORKER: Fetch response from network.', event.request.url); 81 | 82 | caches.open(pupil_docs_cache) 83 | .then(function(cache) { 84 | cache.put(event.request, responseToCache); 85 | }); 86 | 87 | return response; 88 | } 89 | ); 90 | }) 91 | ); 92 | }); 93 | 94 | /* If there is even a byte's difference in the service worker file compared 95 | to what it currently has, the browser considers it new. At this point the old service 96 | worker is still controlling the current pages so the new service worker will 97 | be installed and enter a waiting state. When the currently open pages of your 98 | site are closed, the old service worker will be killed and the new service worker 99 | will take control. 100 | */ 101 | self.addEventListener('activate', function(event) { 102 | 103 | // console.log('WORKER: Activate event in progress...'); 104 | 105 | var cacheWhitelist = [pupil_docs_cache]; 106 | 107 | event.waitUntil( 108 | caches 109 | /* This method returns a promise which will resolve to an array of available 110 | cache keys. 111 | */ 112 | .keys() 113 | .then(function(cacheNames) { 114 | // We return a promise that settles when all outdated caches are deleted. 115 | return Promise.all( 116 | cacheNames.map(function(cacheName) { 117 | if (cacheWhitelist.indexOf(cacheName) === -1) { 118 | /* Return a promise that's fulfilled 119 | when each outdated cache is deleted. 120 | */ 121 | // console.log('WORKER: Outdated cache deleted'); 122 | return caches.delete(cacheName); 123 | } 124 | }) 125 | ); 126 | }) 127 | ); 128 | }); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_search.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_lunr 2 | //= require ../lib/_jquery 3 | //= require ../lib/_jquery.highlight 4 | (function () { 5 | 'use strict'; 6 | 7 | var content, searchResults; 8 | var highlightOpts = { element: 'span', className: 'search-highlight' }; 9 | 10 | var index = new lunr.Index(); 11 | 12 | index.ref('id'); 13 | index.field('title', { boost: 10 }); 14 | index.field('body'); 15 | index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); 16 | 17 | $(populate); 18 | $(bind); 19 | 20 | function populate() { 21 | $('h1, h2').each(function() { 22 | var title = $(this); 23 | var body = title.nextUntil('h1, h2'); 24 | index.add({ 25 | id: title.prop('id'), 26 | title: title.text(), 27 | body: body.text() 28 | }); 29 | }); 30 | } 31 | 32 | function bind() { 33 | content = $('.content'); 34 | searchResults = $('.search-results'); 35 | 36 | $('#input-search').on('keyup', search); 37 | } 38 | 39 | function search(event) { 40 | unhighlight(); 41 | searchResults.addClass('visible'); 42 | 43 | // ESC clears the field 44 | if (event.keyCode === 27) this.value = ''; 45 | 46 | if (this.value) { 47 | var results = index.search(this.value).filter(function(r) { 48 | return r.score > 0.0001; 49 | }); 50 | 51 | if (results.length) { 52 | searchResults.empty(); 53 | $.each(results, function (index, result) { 54 | var elem = document.getElementById(result.ref); 55 | // if contains `link` and `mode_edit`, remove from search result string 56 | var regex = /linkmode_edit|link/; 57 | var txt = $(elem).text().replace(regex,""); 58 | searchResults.append("
  • " + txt + "
  • "); 59 | }); 60 | highlight.call(this); 61 | } else { 62 | searchResults.html('
  • '); 63 | $('.search-results li').text('No Results Found for "' + this.value + '"'); 64 | } 65 | } else { 66 | unhighlight(); 67 | searchResults.removeClass('visible'); 68 | } 69 | } 70 | 71 | function highlight() { 72 | if (this.value) content.highlight(this.value, highlightOpts); 73 | } 74 | 75 | function unhighlight() { 76 | content.unhighlight(highlightOpts); 77 | } 78 | })(); 79 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_toc.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_jquery 2 | //= require ../lib/_jquery_ui 3 | //= require ../lib/_jquery.tocify 4 | //= require ../lib/_imagesloaded.min 5 | (function (global) { 6 | 'use strict'; 7 | 8 | var closeToc = function() { 9 | $(".tocify-wrapper").removeClass('open'); 10 | $("#nav-button").removeClass('open'); 11 | }; 12 | 13 | var makeToc = function() { 14 | global.toc = $("#toc").tocify({ 15 | selectors: 'h1, h2, h3', 16 | extendPage: false, 17 | theme: 'none', 18 | smoothScroll: false, 19 | showAndHideOnScroll: true, 20 | showEffectSpeed: 0, 21 | hideEffectSpeed: 180, 22 | ignoreSelector: '.toc-ignore', 23 | highlightOffset: 90, 24 | highlightOnScroll: true, 25 | highlightDefault: false, 26 | scrollTo: 50, 27 | scrollHistory: false, 28 | 29 | hashGenerator: function (text, element) { 30 | return element.prop('id'); 31 | } 32 | }).data('toc-tocify'); 33 | 34 | $("#nav-button").click(function() { 35 | $(".tocify-wrapper").toggleClass('open'); 36 | $("#nav-button").toggleClass('open'); 37 | return false; 38 | }); 39 | 40 | $("#menu-button").click(function() { 41 | $(".tocify-wrapper").toggleClass('open'); 42 | $("#menu-button").toggleClass('open'); 43 | return false; 44 | }); 45 | 46 | $(".page-wrapper").click(closeToc); 47 | $(".tocify-item").click(closeToc); 48 | }; 49 | 50 | // Hack to make already open sections to start opened, 51 | // instead of displaying an ugly animation 52 | function animate() { 53 | setTimeout(function() { 54 | toc.setOption('showEffectSpeed', 180); 55 | }, 50); 56 | } 57 | 58 | $(function() { 59 | makeToc(); 60 | animate(); 61 | // languages not currently in use - omit 62 | // setupLanguages($('body').data('languages')); 63 | $('.content').imagesLoaded( function() { 64 | global.toc.calculateHeights(); 65 | }); 66 | }); 67 | })(window); 68 | 69 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/app/_youtube-lazyload.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var youtube = document.querySelectorAll( ".youtube" ); 3 | 4 | for (var i = 0; i < youtube.length; i++) { 5 | 6 | var img_embed = youtube[i].dataset.embed.replace(/h.+ed.|[?].+/g,''); 7 | 8 | var img_src = "https://img.youtube.com/vi/"+ img_embed +"/sddefault.jpg"; 9 | 10 | // Load the image asynchronously 11 | var image = new Image(); 12 | image.src = img_src; 13 | image.addEventListener("load", function() { 14 | youtube[i].appendChild(image); 15 | }(i)); 16 | // click event to inject iframe 17 | youtube[i].addEventListener("click", function() { 18 | var iframe = document.createElement("iframe"); 19 | 20 | var iframe_embed = this.dataset.embed.replace(/h.+ed.|[?].+/g,''); 21 | var embed_playlist = this.dataset.embed.match(/[?].+/g,''); 22 | 23 | iframe.setAttribute("frameborder", "0"); 24 | iframe.setAttribute("allowfullscreen", ""); 25 | 26 | if ( embed_playlist === null ) { 27 | iframe.setAttribute("src", "https://www.youtube.com/embed/"+ iframe_embed + "?rel=0&showinfo=0&autoplay=1"); 28 | } else { 29 | iframe.setAttribute("src", "https://www.youtube.com/embed/"+ iframe_embed + embed_playlist + "&rel=0&showinfo=1&autoplay=1&loop=1"); 30 | } 31 | 32 | this.innerHTML = ""; 33 | this.appendChild(iframe); 34 | }); 35 | }; 36 | 37 | })(); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/javascripts/lib/_jquery.highlight.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Highlight plugin 3 | * 4 | * Based on highlight v3 by Johann Burkard 5 | * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html 6 | * 7 | * Code a little bit refactored and cleaned (in my humble opinion). 8 | * Most important changes: 9 | * - has an option to highlight only entire words (wordsOnly - false by default), 10 | * - has an option to be case sensitive (caseSensitive - false by default) 11 | * - highlight element tag and class names can be specified in options 12 | * 13 | * Usage: 14 | * // wrap every occurrance of text 'lorem' in content 15 | * // with (default options) 16 | * $('#content').highlight('lorem'); 17 | * 18 | * // search for and highlight more terms at once 19 | * // so you can save some time on traversing DOM 20 | * $('#content').highlight(['lorem', 'ipsum']); 21 | * $('#content').highlight('lorem ipsum'); 22 | * 23 | * // search only for entire word 'lorem' 24 | * $('#content').highlight('lorem', { wordsOnly: true }); 25 | * 26 | * // don't ignore case during search of term 'lorem' 27 | * $('#content').highlight('lorem', { caseSensitive: true }); 28 | * 29 | * // wrap every occurrance of term 'ipsum' in content 30 | * // with 31 | * $('#content').highlight('ipsum', { element: 'em', className: 'important' }); 32 | * 33 | * // remove default highlight 34 | * $('#content').unhighlight(); 35 | * 36 | * // remove custom highlight 37 | * $('#content').unhighlight({ element: 'em', className: 'important' }); 38 | * 39 | * 40 | * Copyright (c) 2009 Bartek Szopka 41 | * 42 | * Licensed under MIT license. 43 | * 44 | */ 45 | 46 | jQuery.extend({ 47 | highlight: function (node, re, nodeName, className) { 48 | if (node.nodeType === 3) { 49 | var match = node.data.match(re); 50 | if (match) { 51 | var highlight = document.createElement(nodeName || 'span'); 52 | highlight.className = className || 'highlight'; 53 | var wordNode = node.splitText(match.index); 54 | wordNode.splitText(match[0].length); 55 | var wordClone = wordNode.cloneNode(true); 56 | highlight.appendChild(wordClone); 57 | wordNode.parentNode.replaceChild(highlight, wordNode); 58 | return 1; //skip added node in parent 59 | } 60 | } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children 61 | !/(script|style)/i.test(node.tagName) && // ignore script and style nodes 62 | !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted 63 | for (var i = 0; i < node.childNodes.length; i++) { 64 | i += jQuery.highlight(node.childNodes[i], re, nodeName, className); 65 | } 66 | } 67 | return 0; 68 | } 69 | }); 70 | 71 | jQuery.fn.unhighlight = function (options) { 72 | var settings = { className: 'highlight', element: 'span' }; 73 | jQuery.extend(settings, options); 74 | 75 | return this.find(settings.element + "." + settings.className).each(function () { 76 | var parent = this.parentNode; 77 | parent.replaceChild(this.firstChild, this); 78 | parent.normalize(); 79 | }).end(); 80 | }; 81 | 82 | jQuery.fn.highlight = function (words, options) { 83 | var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false }; 84 | jQuery.extend(settings, options); 85 | 86 | if (words.constructor === String) { 87 | words = [words]; 88 | } 89 | words = jQuery.grep(words, function(word, i){ 90 | return word != ''; 91 | }); 92 | words = jQuery.map(words, function(word, i) { 93 | return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 94 | }); 95 | if (words.length == 0) { return this; }; 96 | 97 | var flag = settings.caseSensitive ? "" : "i"; 98 | var pattern = "(" + words.join("|") + ")"; 99 | if (settings.wordsOnly) { 100 | pattern = "\\b" + pattern + "\\b"; 101 | } 102 | var re = new RegExp(pattern, flag); 103 | 104 | return this.each(function () { 105 | jQuery.highlight(this, re, settings.element, settings.className); 106 | }); 107 | }; 108 | 109 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Regular; 3 | src: url(../fonts/Regular-Semibold.woff) format("woff"); 4 | font-weight: weight; 5 | font-style: normal; 6 | font-stretch: normal; 7 | } 8 | 9 | 10 | @font-face { 11 | font-family: AtlasGroteskRegular; 12 | src: url(../fonts/AtlasGrotesk-Regular-Web.woff) format("woff"); 13 | font-weight: weight; 14 | font-style: normal; 15 | font-stretch: normal; 16 | } 17 | 18 | 19 | @import url('//fonts.googleapis.com/css?family=Space+Mono'); 20 | 21 | @import url('https://fonts.googleapis.com/icon?family=Material+Icons'); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_header.scss: -------------------------------------------------------------------------------- 1 | .header-container { 2 | display: block; 3 | left: 0; 4 | transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1); 5 | } 6 | 7 | #header { 8 | &.open { 9 | left: 230px; 10 | } 11 | position: fixed; 12 | top: 0; 13 | left: 0; 14 | transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1); 15 | width: 100vw; 16 | height: $header-height; 17 | z-index: 4; 18 | display: flex; 19 | flex-direction: row; 20 | align-items: flex-start; 21 | } 22 | 23 | 24 | .header-link a { 25 | color: #333; 26 | transition: color .4s ease; 27 | &:hover { 28 | color: #11a08c; 29 | } 30 | } 31 | 32 | // .header-border-top { 33 | // border-top: 1px solid #ccc; 34 | // margin-right: 50%; 35 | // margin-top: 3em; 36 | // } 37 | 38 | // .header-border-bottom { 39 | // border-bottom: 1px solid #ccc; 40 | // margin-right: 50%; 41 | // margin-bottom: 2em; 42 | // } 43 | 44 | @media (max-width: 1024px) { 45 | .header-border-top, .header-border-bottom { 46 | margin-right: 0; 47 | } 48 | } 49 | 50 | .header { 51 | padding: .5em 0; 52 | display: block; 53 | margin: 0; 54 | font-weight: 700; 55 | } 56 | 57 | #menu-button { 58 | display: none; 59 | } 60 | 61 | @media (max-width: $phone-width) { 62 | #menu-button { 63 | display: block; 64 | &.open { 65 | left: 230px; 66 | } 67 | } 68 | } 69 | 70 | .main-header-bg { 71 | background: linear-gradient(to right, #38ea92 0%, #a1def0 100%); 72 | } 73 | 74 | .main-header-menu-button { 75 | cursor: pointer; 76 | background: none; 77 | outline: none; 78 | border: none; 79 | width: 40px; 80 | height: 40px; 81 | padding: 24px 0; 82 | margin-left: 20px; 83 | color: rgba(0, 0, 0, 0.54); 84 | } 85 | 86 | .main-header-logo { 87 | font-family: 'Regular', sans-serif; 88 | display: inline-block; 89 | position: relative; 90 | padding-left: 25px; 91 | font-size: 1.6em; 92 | letter-spacing: -.25px; 93 | cursor: pointer; 94 | } 95 | 96 | .logotype { 97 | font-family: 'Regular', sans-serif; 98 | color: #4d4d4d; 99 | text-decoration: none; 100 | font-size: 1.5em; 101 | } 102 | 103 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_icon-font.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'slate'; 3 | src: url('../fonts/slate.eot?-syv14m'); 4 | src: url('../fonts/slate.eot?#iefix-syv14m') format('embedded-opentype'), 5 | url('../fonts/slate.woff2?-syv14m') format('woff2'), 6 | url('../fonts/slate.woff?-syv14m') format('woff'), 7 | url('../fonts/slate.ttf?-syv14m') format('truetype'), 8 | url('../fonts/slate.svg?-syv14m#slate') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | %icon { 14 | font-family: 'slate'; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | } 22 | 23 | %icon-exclamation-sign { 24 | @extend %icon; 25 | content: "\e600"; 26 | } 27 | %icon-info-sign { 28 | @extend %icon; 29 | content: "\e602"; 30 | } 31 | %icon-ok-sign { 32 | @extend %icon; 33 | content: "\e606"; 34 | } 35 | %icon-search { 36 | @extend %icon; 37 | content: "\e607"; 38 | } 39 | 40 | %material-icon { 41 | font-family: 'Material Icons'; 42 | font-weight: normal; 43 | font-style: normal; 44 | font-size: 24px; 45 | line-height: 1; 46 | letter-spacing: normal; 47 | text-transform: none; 48 | display: inline-block; 49 | white-space: nowrap; 50 | word-wrap: normal; 51 | direction: ltr; 52 | -webkit-font-feature-settings: 'liga'; 53 | -webkit-font-smoothing: antialiased; 54 | } 55 | 56 | %aside-icon { 57 | vertical-align: middle; 58 | padding-right: 0.5em; 59 | } 60 | 61 | %icon-info { 62 | @extend %aside-icon; 63 | @extend %material-icon; 64 | content: "\E88E"; 65 | } 66 | %icon-error { 67 | @extend %aside-icon; 68 | @extend %material-icon; 69 | content: "\E000"; 70 | } 71 | %icon-check-circle { 72 | @extend %aside-icon; 73 | @extend %material-icon; 74 | content: "\E86C"; 75 | } 76 | %icon-help { 77 | @extend %aside-icon; 78 | @extend %material-icon; 79 | content: "\E887"; 80 | } 81 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_lazyload.scss: -------------------------------------------------------------------------------- 1 | .figure-container { 2 | max-width: 75%; 3 | margin: auto; 4 | 5 | &.img-m { 6 | max-width: 50%; 7 | } 8 | 9 | &.img-s { 10 | max-width: 40%; 11 | } 12 | 13 | &.img-xs { 14 | max-width: 18%; 15 | } 16 | } 17 | 18 | .Grid--1of3>.Grid-cell { 19 | .figure-container { 20 | max-width: 100%; 21 | } 22 | } 23 | 24 | // images in grid containers 25 | .Grid-cell--1of2 { 26 | .figure-container { 27 | &.img-m { 28 | width: 250px; 29 | } 30 | } 31 | } 32 | 33 | .Grid--1of3>.Grid-cell { 34 | .figure-container { 35 | width: 165px; 36 | } 37 | } 38 | 39 | // containers 40 | .lazy-img { 41 | margin: auto; 42 | overflow: hidden; 43 | } 44 | 45 | .ratio-box { 46 | position: relative; 47 | height: 0; 48 | display: block; 49 | } 50 | 51 | .ratio-box img, 52 | .ratio-box iframe, 53 | .ratio-box video { 54 | position: absolute; 55 | top: 0; 56 | left: 0; 57 | width: 100%; 58 | height: 100%; 59 | display: block; 60 | } 61 | 62 | .img-small { 63 | filter: blur(25px); 64 | transform: scale(1); 65 | } 66 | 67 | .img-small.lazyloaded { 68 | filter: blur(0); 69 | transform: scale(1); 70 | } 71 | 72 | .img-large { 73 | opacity: 0; 74 | } 75 | 76 | .img-large.lazyloaded { 77 | opacity: 1; 78 | transition: opacity .1s linear; 79 | } 80 | 81 | 82 | @media (max-width: $phone-width) { 83 | .figure-container { 84 | max-width: 70%; 85 | } 86 | 87 | .Grid--1of3>.Grid-cell { 88 | .figure-container { 89 | max-width: 65%; 90 | // min-width: 230px; 91 | } 92 | } 93 | .figure-container { 94 | 95 | &.img-m { 96 | max-width: 56%; 97 | // min-width: 250px; 98 | } 99 | 100 | &.img-s { 101 | max-width: 45%; 102 | } 103 | 104 | &.img-xs { 105 | max-width: 20%; 106 | } 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_plyr-mixins.scss: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // Plyr mixins 3 | // https://github.com/selz/plyr 4 | // ========================================================================== 5 | 6 | // styling 7 | @mixin plyr-range-track() { 8 | height: $plyr-range-track-height; 9 | background: transparent; 10 | border: 0; 11 | border-radius: ($plyr-range-track-height / 2); 12 | user-select: none; 13 | } 14 | @mixin plyr-range-thumb() { 15 | position: relative; 16 | height: $plyr-range-thumb-height; 17 | width: $plyr-range-thumb-width; 18 | background: $plyr-range-thumb-bg; 19 | border: $plyr-range-thumb-border; 20 | border-radius: 100%; 21 | transition: background .2s ease, border .2s ease, transform .2s ease; 22 | box-shadow: $plyr-range-thumb-shadow; 23 | box-sizing: border-box; 24 | } 25 | @mixin plyr-range-thumb-active() { 26 | background: $plyr-range-thumb-active-bg; 27 | border-color: $plyr-range-thumb-active-border-color; 28 | transform: scale($plyr-range-thumb-active-scale); 29 | } -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_plyr-variables.scss: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // Plyr variables 3 | // https://github.com/selz/plyr 4 | // https://robots.thoughtbot.com/sass-default 5 | // ========================================================================== 6 | 7 | // Settings 8 | $plyr-border-box: true !default; 9 | $plyr-touch-action: true !default; 10 | $plyr-sr-only-important: true !default; 11 | 12 | // Colors 13 | $plyr-color-main: #3498db !default; 14 | 15 | // Font sizes 16 | $plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif !default; 17 | $plyr-font-size-small: 14px !default; 18 | $plyr-font-size-base: 16px !default; 19 | 20 | // Captions 21 | $plyr-captions-bg: transparentize(#000, .3) !default; 22 | $plyr-captions-color: #fff !default; 23 | $plyr-font-size-captions-base: $plyr-font-size-base !default; 24 | $plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default; 25 | $plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default; 26 | 27 | // Controls 28 | $plyr-control-icon-size: 18px !default; 29 | $plyr-control-spacing: 10px !default; 30 | $plyr-control-padding: ($plyr-control-spacing * .7) !default; 31 | $plyr-video-controls-bg: #000 !default; 32 | $plyr-video-control-color: rgba(0,0,0,0.3) !default; 33 | $plyr-video-control-color-hover: #fff !default; 34 | $plyr-video-control-bg-hover: rgba(0,0,0,0.7) !default; 35 | $plyr-audio-controls-bg: #fff !default; 36 | $plyr-audio-controls-border: 1px solid #dbe3e8 !default; 37 | $plyr-audio-control-color: #565D64 !default; 38 | $plyr-audio-control-color-hover: #fff !default; 39 | $plyr-audio-control-bg-hover: $plyr-color-main; 40 | 41 | // Tooltips 42 | $plyr-tooltip-bg: transparentize(#000, .3) !default; 43 | $plyr-tooltip-color: #fff !default; 44 | $plyr-tooltip-padding: ($plyr-control-spacing / 2) !default; 45 | $plyr-tooltip-arrow-size: 4px !default; 46 | $plyr-tooltip-radius: 3px !default; 47 | 48 | // Progress 49 | $plyr-progress-loading-size: 25px !default; 50 | $plyr-progress-loading-bg: transparentize(#000, .85) !default; 51 | $plyr-video-progress-bg: transparentize(#fff, .75) !default; 52 | $plyr-video-progress-buffered-bg: $plyr-video-progress-bg !default; 53 | $plyr-audio-progress-bg: transparentize(#C6D6DB, .33) !default; 54 | $plyr-audio-progress-buffered-bg: $plyr-audio-progress-bg !default; 55 | 56 | // Range sliders 57 | $plyr-range-track-height: 8px !default; 58 | $plyr-range-thumb-height: floor($plyr-range-track-height * 2) !default; 59 | $plyr-range-thumb-width: floor($plyr-range-track-height * 2) !default; 60 | $plyr-range-thumb-bg: #fff !default; 61 | $plyr-range-thumb-border: 2px solid transparent !default; 62 | $plyr-range-thumb-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85), 0 0 0 1px transparentize(#000, .85) !default; 63 | $plyr-range-thumb-active-border-color: #fff !default; 64 | $plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default; 65 | $plyr-range-thumb-active-scale: 1.25 !default; 66 | $plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default; 67 | $plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default; 68 | $plyr-range-selected-bg: $plyr-color-main !default; 69 | 70 | // Breakpoints 71 | $plyr-bp-screen-sm: 480px !default; 72 | $plyr-bp-screen-md: 768px !default; 73 | $plyr-bp-screen-lg: 1024px !default; -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_site.scss: -------------------------------------------------------------------------------- 1 | .site { 2 | overflow-y:scroll; 3 | } 4 | 5 | .docs { 6 | position: relative; 7 | width: 100%; 8 | height: 100%; 9 | } 10 | 11 | .docs-body { 12 | position: absolute; 13 | top: 0; 14 | right: 0; 15 | left: 0; 16 | bottom: 0; 17 | overflow-y: auto; 18 | color: #000; 19 | background: #fff; 20 | transition: left 250ms ease 0ms; 21 | } 22 | 23 | .site-transform { 24 | margin-top: -90px; 25 | } 26 | 27 | .site-content-container { 28 | max-width: 1700px; 29 | margin: 0 auto; 30 | padding: 0 60px; 31 | } 32 | 33 | 34 | .content { 35 | a { 36 | cursor: pointer; 37 | font-weight: 500; 38 | text-decoration: none; 39 | color: $a-links; 40 | } 41 | h4 { 42 | cursor: auto; 43 | text-decoration: none; 44 | } 45 | } 46 | 47 | 48 | h2,h3 { 49 | .anchor, 50 | .github-edit { 51 | color: lightgray; 52 | padding: 0em 0em 0em 0.5em; 53 | font-size: 24px; 54 | } 55 | } 56 | 57 | 58 | h1 { 59 | .anchor, 60 | .github-edit { 61 | color: #868686; 62 | padding: 0em 0em 0em 0.5em; 63 | font-size: 28px; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2008-2013 Concur Technologies, Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | not use this file except in compliance with the License. You may obtain 6 | a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | License for the specific language governing permissions and limitations 14 | under the License. 15 | */ 16 | 17 | 18 | //////////////////////////////////////////////////////////////////////////////// 19 | // CUSTOMIZE SLATE 20 | //////////////////////////////////////////////////////////////////////////////// 21 | // Use these settings to help adjust the appearance of Slate 22 | 23 | 24 | // BACKGROUND COLORS 25 | //////////////////// 26 | $nav-bg: #f5f5f5 !default; 27 | $examples-bg: #f1f1f1 !default; 28 | $code-bg: #292929 !default; 29 | $code-annotation-bg: #1c1c1c !default; 30 | $nav-subitem-bg: #ccc !default; 31 | $nav-active-bg: #616161 !default; 32 | $lang-select-border: #000 !default; 33 | $lang-select-bg: #222 !default; 34 | $lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something 35 | $lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed 36 | $main-bg: #ffffff !default; 37 | $aside-bg: #eeeeee !default; 38 | $aside-notice-border: #90caf9 !default; 39 | $aside-warning-border: #ef5350 !default; 40 | $aside-success-border: #9ccc65 !default; 41 | $aside-faq-border: #37474F !default; 42 | $search-notice-bg: #c97a7e !default; 43 | $search-bg: #ccc !default; 44 | $nav-subheader-bg: #E0E0E0 !default; 45 | $nav-subh3-bg: #9E9E9E !default; 46 | $a-links: #00ACC1 !default; 47 | 48 | // TEXT COLORS 49 | //////////////////// 50 | $main-text: #333 !default; // main content text color 51 | $nav-text: #424242 !default; 52 | $nav-active-text: #fff !default; 53 | $lang-select-text: #fff !default; // color of unselected language tab text 54 | $lang-select-active-text: #fff !default; // color of selected language tab text 55 | $lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed 56 | $aside-text: #212121 !default; // aside text color 57 | 58 | 59 | // SIZES 60 | //////////////////// 61 | $nav-width: 230px !default; // width of the navbar 62 | $examples-width: 50% !default; // portion of the screen taken up by code examples 63 | $logo-margin: 20px !default; // margin between nav items and logo, ignored if search is active 64 | $main-padding: 30px !default; // padding to left and right of content & examples 65 | $nav-padding: 15px !default; // padding to left and right of navbar 66 | $nav-v-padding: 10px !default; // padding used vertically around search boxes and results 67 | $nav-indent: 10px !default; // extra padding for ToC subitems 68 | $code-annotation-padding: 13px !default; // padding inside code annotations 69 | $h1-margin-bottom: 21px !default; // padding under the largest header tags 70 | $phone-width: 768px !default; // min width before reverting to tablet size 71 | $laptop-width: 1024px !default; // min width before reverting to mobile size 72 | $max-content-width: 1440px !default; //max width of the content section 73 | 74 | 75 | // FONTS 76 | //////////////////// 77 | %default-font { 78 | font-family: "AtlasGroteskRegular", Helvetica, Arial, sans-serif; 79 | font-size: 14px; 80 | } 81 | 82 | %header-font { 83 | font-family: "Regular", Helvetica, Arial, sans-serif; 84 | font-weight: bold; 85 | } 86 | 87 | %code-font { 88 | font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; 89 | font-size: 12px; 90 | line-height: 1.5; 91 | } 92 | 93 | 94 | // FONT-SIZES 95 | //////////////////// 96 | $h1-size: 2.4em !default; 97 | $h2-size: 2em !default; 98 | $h3-size: 1.6em !default; 99 | $h4-size: 1.2em !default; 100 | $h5-size: 1em !default; 101 | 102 | // OTHER 103 | //////////////////// 104 | $nav-active-shadow: #000 !default; 105 | $nav-footer-border-color: #666 !default; 106 | $nav-embossed-border-top: #000 !default; 107 | $nav-embossed-border-bottom: #939393 !default; 108 | $main-embossed-text-shadow: 0px 1px 0px #fff !default; 109 | $search-box-border-color: #666 !default; 110 | 111 | $header-height: 50px; 112 | 113 | //////////////////////////////////////////////////////////////////////////////// 114 | // INTERNAL 115 | //////////////////////////////////////////////////////////////////////////////// 116 | // These settings are probably best left alone. 117 | 118 | %break-words { 119 | word-break: break-word; 120 | hyphens: auto; 121 | } 122 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/slate/stylesheets/monokai.scss: -------------------------------------------------------------------------------- 1 | .highlight pre { background-color: #272822; } 2 | .highlight .hll { background-color: #272822; } 3 | .highlight .c { color: #75715e } /* Comment */ 4 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 5 | .highlight .k { color: #66d9ef } /* Keyword */ 6 | .highlight .l { color: #ae81ff } /* Literal */ 7 | .highlight .n { color: #f8f8f2 } /* Name */ 8 | .highlight .o { color: #f92672 } /* Operator */ 9 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 10 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 11 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 12 | .highlight .c1 { color: #75715e } /* Comment.Single */ 13 | .highlight .cs { color: #75715e } /* Comment.Special */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 16 | .highlight .kc { color: #66d9ef } /* Keyword.Constant */ 17 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 18 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 19 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 20 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 21 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 22 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 23 | .highlight .m { color: #ae81ff } /* Literal.Number */ 24 | .highlight .s { color: #e6db74 } /* Literal.String */ 25 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 26 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 27 | .highlight .nc { color: #a6e22e } /* Name.Class */ 28 | .highlight .no { color: #66d9ef } /* Name.Constant */ 29 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 30 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 31 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 32 | .highlight .nf { color: #a6e22e } /* Name.Function */ 33 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 34 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 35 | .highlight .nx { color: #a6e22e } /* Name.Other */ 36 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 37 | .highlight .nt { color: #f92672 } /* Name.Tag */ 38 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 39 | .highlight .ow { color: #f92672 } /* Operator.Word */ 40 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 41 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 42 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 47 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ 49 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 50 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 53 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 55 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 61 | 62 | .highlight .gh { } /* Generic Heading & Diff Header */ 63 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 64 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 65 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 66 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/stylesheets/_docuapi.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | // The section(s) below are just pulled over from _variables.scss in Slate and adjusted. 4 | 5 | // Make the selected code language a nice blue. 6 | $lang-select-active-bg: $nav-active-bg; 7 | 8 | // Make the main background color slightly lighter than the original. 9 | $main-bg: lighten(#eaf2f6, 2%); 10 | 11 | 12 | // This will be added as the last import to the original Slate screen.css.scs. TOOD(bep) Print? 13 | 14 | .content { 15 | // prevent clearing of higlight divs 16 | &>div.highlight { 17 | clear:none; 18 | } 19 | } 20 | 21 | .toc-footer { 22 | .translations-title { 23 | background-color: $nav-subitem-bg; 24 | padding: 10px $nav-padding; 25 | color: $nav-text; 26 | font-size: 12px; 27 | } 28 | } 29 | 30 | 31 | 32 | // Getting the paths just right for Android and iOS and friends is hard ... 33 | @font-face { 34 | font-family:'slate'; 35 | src:url(/fonts/slate.eot?-syv14m); 36 | src:url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), 37 | url(../fonts/slate.woff2?-syv14m) format("woff2"), 38 | url(../fonts/slate.woff?-syv14m) format("woff"), 39 | url(../fonts/slate.ttf?-syv14m) format("truetype"), 40 | url(../fonts/slate.svg?-syv14m#slate) format("svg"); 41 | font-weight: normal; 42 | font-style: normal; 43 | } -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/assets/stylesheets/monokai.css: -------------------------------------------------------------------------------- 1 | .highlight pre { background-color: #272822; } 2 | .highlight .hll { background-color: #272822; } 3 | .highlight .c { color: #75715e } /* Comment */ 4 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 5 | .highlight .k { color: #66d9ef } /* Keyword */ 6 | .highlight .l { color: #ae81ff } /* Literal */ 7 | .highlight .n { color: #f8f8f2 } /* Name */ 8 | .highlight .o { color: #f92672 } /* Operator */ 9 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 10 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 11 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 12 | .highlight .c1 { color: #75715e } /* Comment.Single */ 13 | .highlight .cs { color: #75715e } /* Comment.Special */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 16 | .highlight .kc { color: #66d9ef } /* Keyword.Constant */ 17 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 18 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 19 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 20 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 21 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 22 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 23 | .highlight .m { color: #ae81ff } /* Literal.Number */ 24 | .highlight .s { color: #e6db74 } /* Literal.String */ 25 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 26 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 27 | .highlight .nc { color: #a6e22e } /* Name.Class */ 28 | .highlight .no { color: #66d9ef } /* Name.Constant */ 29 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 30 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 31 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 32 | .highlight .nf { color: #a6e22e } /* Name.Function */ 33 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 34 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 35 | .highlight .nx { color: #a6e22e } /* Name.Other */ 36 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 37 | .highlight .nt { color: #f92672 } /* Name.Tag */ 38 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 39 | .highlight .ow { color: #f92672 } /* Operator.Word */ 40 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 41 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 42 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 47 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ 49 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 50 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 53 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 55 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 61 | 62 | .highlight .gh { } /* Generic Heading & Diff Header */ 63 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 64 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 65 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 66 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/i18n/en.yaml: -------------------------------------------------------------------------------- 1 | - id: translations 2 | translation: 3 | one: "Translation" 4 | other: "Translations" 5 | 6 | # Search label 7 | - id: search 8 | translation: "Search" 9 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/404.html: -------------------------------------------------------------------------------- 1 | {{define "main"}} 2 |

    404

    3 |

    Oops... The page you are looking for does not exist.

    4 |

    Head back to docs.pupil-labs.com

    5 |

    Or visit pupil-labs.com

    6 | {{end}} -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "header.html" . }} 5 | 6 | 7 |
    8 | 11 |
    12 | {{ with .Site.Params.language_tabs }} 13 |
    14 | {{ range . }} 15 | {{ .name }} 16 | {{ end }} 17 |
    18 | {{ end }} 19 | {{ if .Site.Params.search }} 20 | 23 |
      24 | {{ end }} 25 |
      26 |
      27 | {{ if .Site.IsMultiLingual }} 28 | 40 | {{ end }} 41 |
      42 |
      43 |
      44 | 53 |
      54 |
      55 |
      56 | {{block "main" .}}This is the main content.{{end}} 57 |
      58 |
      59 | {{ with .Site.Params.language_tabs }} 60 |
      61 | {{ range . }} 62 | {{ .name }} 63 | {{ end }} 64 |
      65 | {{ end }} 66 |
      67 |
      68 |
      69 | {{ partial "footer.html" . }} 70 | 71 | 72 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{define "main"}} 2 | {{ range $elem := .Data.Pages.GroupByParam "section_weight" }} 3 | {{ range $pw := ($elem.Pages.ByParam "page_weight") }} 4 | 5 | {{ .Content }} 6 | {{ end }} 7 | {{ end }} 8 | {{end}} -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/analytics.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/custom-js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 |
      2 | {{ partial "custom-js.html" . }} 3 | {{ partial "analytics.html" . }} 4 |
      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | {{ .Title }} 40 | {{ partial "styles.html" . }} 41 | {{ partial "js.html" . }} 42 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/js.html: -------------------------------------------------------------------------------- 1 | {{ if .Param "search" }} 2 | 3 | {{ else }} 4 | 5 | {{ end }} -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/service_worker.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/partials/translations.html: -------------------------------------------------------------------------------- 1 | {{ if .IsTranslated }} 2 | 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/figure-img.html: -------------------------------------------------------------------------------- 1 |
      2 | {{ with .Get 3 |
      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/footnote.html: -------------------------------------------------------------------------------- 1 |

      2 | [{{ with .Get "number" }}{{ . }}{{ end }}] 3 | {{ with .Get "text" }}{{ . }}{{ end }} 4 |

      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/lqip-img.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ with .Get "src" }} 5 | {{ $.Scratch.Set "imgPath" (printf "/content%s" . ) }} 6 | {{ end }} 7 | 8 | {{ with (imageConfig ( $.Scratch.Get "imgPath" ) ) }} 9 | {{ $.Scratch.Set "ratio" (printf "%.4f%%" (mul (div (mul .Height 1.0) (mul .Width 1.0)) 100.0)) }} 10 | {{ end }} 11 | 12 | {{ $ratio := $.Scratch.Get "ratio" }} 13 | 14 | 15 | 16 | 17 |
      18 |
      19 | {{ with .Get 20 | {{ with .Get 21 |
      22 |
      23 | 24 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/video-webm.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ with .Get "src" }} 6 | {{ $.Scratch.Set "srcBaseName" (replaceRE "(.*)[.](webm|mov|jpe?g)" "$1" . ) }} 7 | {{ end }} 8 | 9 | 10 |
      11 |
      12 | 17 |
      18 |
      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/video-youtube.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 |
      5 |
      6 |
      7 |
      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/layouts/shortcodes/webp-img.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ with .Get "src" }} 5 | {{ $.Scratch.Set "jpgPath" ( . | replaceRE "(.*)[.](jpe?g|png|gif|webp)" (printf "/content%s.jpg" "$1" )) }} 6 | {{ end }} 7 | 8 | 9 | {{ with (imageConfig ( $.Scratch.Get "jpgPath" ) ) }} 10 | {{ $.Scratch.Set "ratio" (printf "%.4f%%" (mul (div (mul .Height 1.0) (mul .Width 1.0)) 100.0)) }} 11 | {{ end }} 12 | 13 | 14 | {{ $ratio := $.Scratch.Get "ratio" }} 15 | 16 | 17 | {{ with .Get "src" }} 18 | {{ $.Scratch.Set "srcBaseName" (replaceRE "(.*)[.](jpe?g|png|gif|webp)" "$1" . ) }} 19 | {{ end }} 20 | 21 |
      22 | 23 | 24 | 25 | {{ with .Get 26 | {{ with .Get 27 | 28 |
      -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/AtlasGrotesk-Regular-Web.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/AtlasGrotesk-Regular-Web.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/Regular-Semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/Regular-Semibold.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/slate.eot -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/slate.ttf -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/slate.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/old_slate/fonts/slate.woff2 -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/stylesheets/monokai.css: -------------------------------------------------------------------------------- 1 | .highlight pre{background-color:#272822}.highlight .hll{background-color:#272822}.highlight .c{color:#75715e}.highlight .err{color:#960050;background-color:#1e0010}.highlight .k{color:#66d9ef}.highlight .l{color:#ae81ff}.highlight .n{color:#f8f8f2}.highlight .o{color:#f92672}.highlight .p{color:#f8f8f2}.highlight .cm{color:#75715e}.highlight .cp{color:#75715e}.highlight .c1{color:#75715e}.highlight .cs{color:#75715e}.highlight .ge{font-style:italic}.highlight .gs{font-weight:bold}.highlight .kc{color:#66d9ef}.highlight .kd{color:#66d9ef}.highlight .kn{color:#f92672}.highlight .kp{color:#66d9ef}.highlight .kr{color:#66d9ef}.highlight .kt{color:#66d9ef}.highlight .ld{color:#e6db74}.highlight .m{color:#ae81ff}.highlight .s{color:#e6db74}.highlight .na{color:#a6e22e}.highlight .nb{color:#f8f8f2}.highlight .nc{color:#a6e22e}.highlight .no{color:#66d9ef}.highlight .nd{color:#a6e22e}.highlight .ni{color:#f8f8f2}.highlight .ne{color:#a6e22e}.highlight .nf{color:#a6e22e}.highlight .nl{color:#f8f8f2}.highlight .nn{color:#f8f8f2}.highlight .nx{color:#a6e22e}.highlight .py{color:#f8f8f2}.highlight .nt{color:#f92672}.highlight .nv{color:#f8f8f2}.highlight .ow{color:#f92672}.highlight .w{color:#f8f8f2}.highlight .mf{color:#ae81ff}.highlight .mh{color:#ae81ff}.highlight .mi{color:#ae81ff}.highlight .mo{color:#ae81ff}.highlight .sb{color:#e6db74}.highlight .sc{color:#e6db74}.highlight .sd{color:#e6db74}.highlight .s2{color:#e6db74}.highlight .se{color:#ae81ff}.highlight .sh{color:#e6db74}.highlight .si{color:#e6db74}.highlight .sx{color:#e6db74}.highlight .sr{color:#e6db74}.highlight .s1{color:#e6db74}.highlight .ss{color:#e6db74}.highlight .bp{color:#f8f8f2}.highlight .vc{color:#f8f8f2}.highlight .vg{color:#f8f8f2}.highlight .vi{color:#f8f8f2}.highlight .il{color:#ae81ff}.highlight .gu{color:#75715e}.highlight .gd{color:#f92672}.highlight .gi{color:#a6e22e} 2 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/old_slate/stylesheets/print.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.content h1,.content h2,.content h3,.content h4,body{font-family:"Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;font-size:13px}.content h1,.content h2,.content h3,.content h4{font-weight:bold}.content pre,.content code{font-family:Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;font-size:12px;line-height:1.5}.content pre,.content code{word-break:break-all;hyphens:auto}@font-face{font-family:'slate';src:font-url("slate.eot?-syv14m");src:font-url("slate.eot?#iefix-syv14m") format("embedded-opentype"),font-url("slate.woff2?-syv14m") format("woff2"),font-url("slate.woff?-syv14m") format("woff"),font-url("slate.ttf?-syv14m") format("truetype"),font-url("slate.svg?-syv14m#slate") format("svg");font-weight:normal;font-style:normal}.content aside.warning:before,.content aside.notice:before,.content aside.success:before{font-family:'slate';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1}.content aside.warning:before{content:"\e600"}.content aside.notice:before{content:"\e602"}.content aside.success:before{content:"\e606"}.tocify,.toc-footer,.lang-selector,.search,#nav-button{display:none}.tocify-wrapper>img{margin:0 auto;display:block}.content{font-size:12px}.content pre,.content code{border:1px solid #999;border-radius:5px;font-size:0.8em}.content pre code{border:0}.content pre{padding:1.3em}.content code{padding:0.2em}.content table{border:1px solid #999}.content table tr{border-bottom:1px solid #999}.content table td,.content table th{padding:0.7em}.content p{line-height:1.5}.content a{text-decoration:none;color:#000}.content h1{font-size:2.5em;padding-top:0.5em;padding-bottom:0.5em;margin-top:1em;margin-bottom:21px;border:2px solid #ccc;border-width:2px 0;text-align:center}.content h2{font-size:1.8em;margin-top:2em;border-top:2px solid #ccc;padding-top:0.8em}.content h1+h2,.content h1+div+h2{border-top:none;padding-top:0;margin-top:0}.content h3,.content h4{font-size:0.8em;margin-top:1.5em;margin-bottom:0.8em;text-transform:uppercase}.content h5,.content h6{text-transform:uppercase}.content aside{padding:1em;border:1px solid #ccc;border-radius:5px;margin-top:1.5em;margin-bottom:1.5em;line-height:1.6}.content aside:before{vertical-align:middle;padding-right:0.5em;font-size:14px} 2 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/requirements.txt: -------------------------------------------------------------------------------- 1 | Pygments==2.15.0 2 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008-2013 Concur Technologies, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | not use this file except in compliance with the License. You may obtain 5 | a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | License for the specific language governing permissions and limitations 13 | under the License. -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/README.md: -------------------------------------------------------------------------------- 1 | # slate 2 | 3 | Minimal version of slate without middleman. Just js, styles, and fonts. 4 | 5 | See master branch for original readme. 6 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/AtlasGrotesk-Regular-Web.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/AtlasGrotesk-Regular-Web.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/Regular-Semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/Regular-Semibold.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/slate.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/slate.eot -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/slate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/slate.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/slate.ttf -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/slate.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/slate.woff -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/fonts/slate.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masukomi/private_comments/a32572fe32af71ef31e967032ced2d1b2024dcbb/site/themes/nathakit_docuapi/static/slate/fonts/slate.woff2 -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | // on document load - version selector should show current version 4 | $("#version-selector").val(window.location.pathname.replace(/\//g,'')); 5 | 6 | $(".anchor").click( function() { 7 | event.preventDefault(); 8 | history.replaceState(null, null, $(this).attr("href")); 9 | $(window).scrollTop($("div[data-unique='"+$(this).attr("name")+"']").offset().top - 49); 10 | }) 11 | 12 | $("#version-selector").change(function() { 13 | var value = $(this).val(); 14 | var cannonical_url = "http://docs.pupil-labs.com/"; 15 | var hash = window.location.hash; 16 | window.location.href = cannonical_url+value+hash; 17 | }); 18 | 19 | }); 20 | 21 | document.addEventListener("DOMContentLoaded", function() { 22 | 23 | var elements = document.getElementsByClassName('github-link'); 24 | 25 | for (var i = 0; i < elements.length; i++) { 26 | var _e = elements[i]; 27 | var section_link = _e.getAttribute('data-github'); 28 | 29 | while (_e.nextElementSibling && !_e.nextElementSibling.matches('.github-link')) { 30 | if (_e.matches("h1") || _e.matches("h2") || _e.matches("h3")){ 31 | // the h1,h2,h3 nodes have text and two links as children 32 | // child_nodes[1] is the first link (hash link to the section) 33 | // child_nodes[2] or lastChild is the external link to github 34 | var child_nodes = _e.childNodes; 35 | var heading_hash = child_nodes[1].getAttribute('href'); 36 | var hash_link = section_link + heading_hash; 37 | var github_edit_link = _e.lastChild; 38 | github_edit_link.setAttribute('href',hash_link); 39 | github_edit_link.insertAdjacentHTML('afterbegin','mode_edit'); 40 | } 41 | _e = _e.nextElementSibling; 42 | } 43 | 44 | } 45 | 46 | }); 47 | 48 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_modernizr-webp_poster.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded", function(event) { 2 | 'use-strict'; 3 | Modernizr.on('webp', function (result) { 4 | // Get all the video tags in the DOM 5 | var video = document.getElementsByTagName('video'); 6 | // Iterate through the list and get he poster attribute 7 | for (var i=0; i < video.length; i++) { 8 | var poster_url = video[i].getAttribute('poster'); 9 | 10 | if (!result) { 11 | // if browser check fails then replace webp with jpg 12 | var jpg = poster_url.replace(/[.]webp/g,".jpg"); 13 | video[i].setAttribute('poster', jpg) 14 | } 15 | } 16 | }) 17 | }); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_plyrcontrols.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // This is the bare minimum JavaScript. You can opt to pass no arguments to setup. 3 | // e.g. just plyr.setup(); and leave it at that if you have no need for events 4 | var instances = plyr.setup({ 5 | // Output to console 6 | controls: ["play-large", "fullscreen"] 7 | }); 8 | 9 | })(); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_pupil_sw.js: -------------------------------------------------------------------------------- 1 | 'use-strict' 2 | 3 | /* A version number is useful when updating the worker logic, 4 | allowing you to remove outdated cache entries during the update. 5 | */ 6 | 7 | var gitVersion = 'c63de0b'; 8 | var pupil_docs_cache = gitVersion+"::docs-cache"; 9 | 10 | /* These resources will be downloaded and cached by the service worker 11 | during the installation process. If any resource fails to be downloaded, 12 | then the service worker won't be installed either. 13 | */ 14 | var urlsToCache = [ 15 | // '/' 16 | '/slate/stylesheets/screen.min.css', 17 | '/slate/javascripts/all.min.js', 18 | '/slate/javascripts/plyr.min.js', 19 | '/slate/javascripts/yt-lazyload.min.js', 20 | '/videos/', 21 | '/images/' 22 | ]; 23 | 24 | // console.log('WORKER: Executing...'); 25 | 26 | self.addEventListener('install', function(event) { 27 | // console.log('WORKER: Installing...'+gitVersion) 28 | /* Using event.waitUntil(p) blocks the installation process on the provided 29 | promise. If the promise is rejected, the service worker won't be installed. 30 | */ 31 | event.waitUntil( 32 | caches.open(pupil_docs_cache) 33 | .then(function(cache) { 34 | // console.log('Opened cache'); 35 | return cache.addAll(urlsToCache); 36 | }) 37 | // .then(function() { 38 | // console.log('WORKER: Install completed'); 39 | // }) 40 | ); 41 | }); 42 | 43 | /* The fetch event fires whenever a page controlled by this service worker requests 44 | a resource. This isn't limited to `fetch` or even XMLHttpRequest. Instead, it 45 | comprehends even the request for the HTML page on first load, as well as JS and 46 | CSS resources, fonts, any images, etc. 47 | */ 48 | 49 | self.addEventListener('fetch', function(event) { 50 | // console.log('WORKER: Fetch event in progress...'); 51 | event.respondWith( 52 | caches.match(event.request) 53 | .then(function(response) { 54 | // Cache hit - return response 55 | if (response) { 56 | return response; 57 | } 58 | 59 | /* IMPORTANT: Clone the request. A request is a stream and 60 | can only be consumed once. Since we are consuming this 61 | once by cache and once by the browser for fetch, we need 62 | to clone the response. 63 | */ 64 | var fetchRequest = event.request.clone(); 65 | 66 | return fetch(fetchRequest).then( 67 | function(response) { 68 | // Check if we received a valid response 69 | if(!response || response.status !== 200 || response.type !== 'basic') { 70 | return response; 71 | } 72 | 73 | /* IMPORTANT: Clone the response. A response is a stream 74 | and because we want the browser to consume the response 75 | as well as the cache consuming the response, we need 76 | to clone it so we have two streams. 77 | */ 78 | var responseToCache = response.clone(); 79 | 80 | // console.log('WORKER: Fetch response from network.', event.request.url); 81 | 82 | caches.open(pupil_docs_cache) 83 | .then(function(cache) { 84 | cache.put(event.request, responseToCache); 85 | }); 86 | 87 | return response; 88 | } 89 | ); 90 | }) 91 | ); 92 | }); 93 | 94 | /* If there is even a byte's difference in the service worker file compared 95 | to what it currently has, the browser considers it new. At this point the old service 96 | worker is still controlling the current pages so the new service worker will 97 | be installed and enter a waiting state. When the currently open pages of your 98 | site are closed, the old service worker will be killed and the new service worker 99 | will take control. 100 | */ 101 | self.addEventListener('activate', function(event) { 102 | 103 | // console.log('WORKER: Activate event in progress...'); 104 | 105 | var cacheWhitelist = [pupil_docs_cache]; 106 | 107 | event.waitUntil( 108 | caches 109 | /* This method returns a promise which will resolve to an array of available 110 | cache keys. 111 | */ 112 | .keys() 113 | .then(function(cacheNames) { 114 | // We return a promise that settles when all outdated caches are deleted. 115 | return Promise.all( 116 | cacheNames.map(function(cacheName) { 117 | if (cacheWhitelist.indexOf(cacheName) === -1) { 118 | /* Return a promise that's fulfilled 119 | when each outdated cache is deleted. 120 | */ 121 | // console.log('WORKER: Outdated cache deleted'); 122 | return caches.delete(cacheName); 123 | } 124 | }) 125 | ); 126 | }) 127 | ); 128 | }); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_search.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_lunr 2 | //= require ../lib/_jquery 3 | //= require ../lib/_jquery.highlight 4 | (function () { 5 | 'use strict'; 6 | 7 | var content, searchResults; 8 | var highlightOpts = { element: 'span', className: 'search-highlight' }; 9 | 10 | var index = new lunr.Index(); 11 | 12 | index.ref('id'); 13 | index.field('title', { boost: 10 }); 14 | index.field('body'); 15 | index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); 16 | 17 | $(populate); 18 | $(bind); 19 | 20 | function populate() { 21 | $('h1, h2').each(function() { 22 | var title = $(this); 23 | var body = title.nextUntil('h1, h2'); 24 | index.add({ 25 | id: title.prop('id'), 26 | title: title.text(), 27 | body: body.text() 28 | }); 29 | }); 30 | } 31 | 32 | function bind() { 33 | content = $('.content'); 34 | searchResults = $('.search-results'); 35 | 36 | $('#input-search').on('keyup', search); 37 | } 38 | 39 | function search(event) { 40 | unhighlight(); 41 | searchResults.addClass('visible'); 42 | 43 | // ESC clears the field 44 | if (event.keyCode === 27) this.value = ''; 45 | 46 | if (this.value) { 47 | var results = index.search(this.value).filter(function(r) { 48 | return r.score > 0.0001; 49 | }); 50 | 51 | if (results.length) { 52 | searchResults.empty(); 53 | $.each(results, function (index, result) { 54 | var elem = document.getElementById(result.ref); 55 | // if contains `link` and `mode_edit`, remove from search result string 56 | var regex = /linkmode_edit|link/; 57 | var txt = $(elem).text().replace(regex,""); 58 | searchResults.append("
    • " + txt + "
    • "); 59 | }); 60 | highlight.call(this); 61 | } else { 62 | searchResults.html('
    • '); 63 | $('.search-results li').text('No Results Found for "' + this.value + '"'); 64 | } 65 | } else { 66 | unhighlight(); 67 | searchResults.removeClass('visible'); 68 | } 69 | } 70 | 71 | function highlight() { 72 | if (this.value) content.highlight(this.value, highlightOpts); 73 | } 74 | 75 | function unhighlight() { 76 | content.unhighlight(highlightOpts); 77 | } 78 | })(); 79 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_toc.js: -------------------------------------------------------------------------------- 1 | //= require ../lib/_jquery 2 | //= require ../lib/_jquery_ui 3 | //= require ../lib/_jquery.tocify 4 | //= require ../lib/_imagesloaded.min 5 | (function (global) { 6 | 'use strict'; 7 | 8 | var closeToc = function() { 9 | $(".tocify-wrapper").removeClass('open'); 10 | $("#nav-button").removeClass('open'); 11 | }; 12 | 13 | var makeToc = function() { 14 | global.toc = $("#toc").tocify({ 15 | selectors: 'h1, h2, h3', 16 | extendPage: false, 17 | theme: 'none', 18 | smoothScroll: false, 19 | showAndHideOnScroll: true, 20 | showEffectSpeed: 0, 21 | hideEffectSpeed: 180, 22 | ignoreSelector: '.toc-ignore', 23 | highlightOffset: 90, 24 | highlightOnScroll: true, 25 | highlightDefault: false, 26 | scrollTo: 50, 27 | scrollHistory: false, 28 | 29 | hashGenerator: function (text, element) { 30 | return element.prop('id'); 31 | } 32 | }).data('toc-tocify'); 33 | 34 | $("#nav-button").click(function() { 35 | $(".tocify-wrapper").toggleClass('open'); 36 | $("#nav-button").toggleClass('open'); 37 | return false; 38 | }); 39 | 40 | $("#menu-button").click(function() { 41 | $(".tocify-wrapper").toggleClass('open'); 42 | $("#menu-button").toggleClass('open'); 43 | return false; 44 | }); 45 | 46 | $(".page-wrapper").click(closeToc); 47 | $(".tocify-item").click(closeToc); 48 | }; 49 | 50 | // Hack to make already open sections to start opened, 51 | // instead of displaying an ugly animation 52 | function animate() { 53 | setTimeout(function() { 54 | toc.setOption('showEffectSpeed', 180); 55 | }, 50); 56 | } 57 | 58 | $(function() { 59 | makeToc(); 60 | animate(); 61 | // languages not currently in use - omit 62 | // setupLanguages($('body').data('languages')); 63 | $('.content').imagesLoaded( function() { 64 | global.toc.calculateHeights(); 65 | }); 66 | }); 67 | })(window); 68 | 69 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/app/_youtube-lazyload.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var youtube = document.querySelectorAll( ".youtube" ); 3 | 4 | for (var i = 0; i < youtube.length; i++) { 5 | 6 | var img_embed = youtube[i].dataset.embed.replace(/h.+ed.|[?].+/g,''); 7 | 8 | var img_src = "https://img.youtube.com/vi/"+ img_embed +"/sddefault.jpg"; 9 | 10 | // Load the image asynchronously 11 | var image = new Image(); 12 | image.src = img_src; 13 | image.addEventListener("load", function() { 14 | youtube[i].appendChild(image); 15 | }(i)); 16 | // click event to inject iframe 17 | youtube[i].addEventListener("click", function() { 18 | var iframe = document.createElement("iframe"); 19 | 20 | var iframe_embed = this.dataset.embed.replace(/h.+ed.|[?].+/g,''); 21 | var embed_playlist = this.dataset.embed.match(/[?].+/g,''); 22 | 23 | iframe.setAttribute("frameborder", "0"); 24 | iframe.setAttribute("allowfullscreen", ""); 25 | 26 | if ( embed_playlist === null ) { 27 | iframe.setAttribute("src", "https://www.youtube.com/embed/"+ iframe_embed + "?rel=0&showinfo=0&autoplay=1"); 28 | } else { 29 | iframe.setAttribute("src", "https://www.youtube.com/embed/"+ iframe_embed + embed_playlist + "&rel=0&showinfo=1&autoplay=1&loop=1"); 30 | } 31 | 32 | this.innerHTML = ""; 33 | this.appendChild(iframe); 34 | }); 35 | }; 36 | 37 | })(); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/javascripts/lib/_jquery.highlight.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Highlight plugin 3 | * 4 | * Based on highlight v3 by Johann Burkard 5 | * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html 6 | * 7 | * Code a little bit refactored and cleaned (in my humble opinion). 8 | * Most important changes: 9 | * - has an option to highlight only entire words (wordsOnly - false by default), 10 | * - has an option to be case sensitive (caseSensitive - false by default) 11 | * - highlight element tag and class names can be specified in options 12 | * 13 | * Usage: 14 | * // wrap every occurrance of text 'lorem' in content 15 | * // with (default options) 16 | * $('#content').highlight('lorem'); 17 | * 18 | * // search for and highlight more terms at once 19 | * // so you can save some time on traversing DOM 20 | * $('#content').highlight(['lorem', 'ipsum']); 21 | * $('#content').highlight('lorem ipsum'); 22 | * 23 | * // search only for entire word 'lorem' 24 | * $('#content').highlight('lorem', { wordsOnly: true }); 25 | * 26 | * // don't ignore case during search of term 'lorem' 27 | * $('#content').highlight('lorem', { caseSensitive: true }); 28 | * 29 | * // wrap every occurrance of term 'ipsum' in content 30 | * // with 31 | * $('#content').highlight('ipsum', { element: 'em', className: 'important' }); 32 | * 33 | * // remove default highlight 34 | * $('#content').unhighlight(); 35 | * 36 | * // remove custom highlight 37 | * $('#content').unhighlight({ element: 'em', className: 'important' }); 38 | * 39 | * 40 | * Copyright (c) 2009 Bartek Szopka 41 | * 42 | * Licensed under MIT license. 43 | * 44 | */ 45 | 46 | jQuery.extend({ 47 | highlight: function (node, re, nodeName, className) { 48 | if (node.nodeType === 3) { 49 | var match = node.data.match(re); 50 | if (match) { 51 | var highlight = document.createElement(nodeName || 'span'); 52 | highlight.className = className || 'highlight'; 53 | var wordNode = node.splitText(match.index); 54 | wordNode.splitText(match[0].length); 55 | var wordClone = wordNode.cloneNode(true); 56 | highlight.appendChild(wordClone); 57 | wordNode.parentNode.replaceChild(highlight, wordNode); 58 | return 1; //skip added node in parent 59 | } 60 | } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children 61 | !/(script|style)/i.test(node.tagName) && // ignore script and style nodes 62 | !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted 63 | for (var i = 0; i < node.childNodes.length; i++) { 64 | i += jQuery.highlight(node.childNodes[i], re, nodeName, className); 65 | } 66 | } 67 | return 0; 68 | } 69 | }); 70 | 71 | jQuery.fn.unhighlight = function (options) { 72 | var settings = { className: 'highlight', element: 'span' }; 73 | jQuery.extend(settings, options); 74 | 75 | return this.find(settings.element + "." + settings.className).each(function () { 76 | var parent = this.parentNode; 77 | parent.replaceChild(this.firstChild, this); 78 | parent.normalize(); 79 | }).end(); 80 | }; 81 | 82 | jQuery.fn.highlight = function (words, options) { 83 | var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false }; 84 | jQuery.extend(settings, options); 85 | 86 | if (words.constructor === String) { 87 | words = [words]; 88 | } 89 | words = jQuery.grep(words, function(word, i){ 90 | return word != ''; 91 | }); 92 | words = jQuery.map(words, function(word, i) { 93 | return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 94 | }); 95 | if (words.length == 0) { return this; }; 96 | 97 | var flag = settings.caseSensitive ? "" : "i"; 98 | var pattern = "(" + words.join("|") + ")"; 99 | if (settings.wordsOnly) { 100 | pattern = "\\b" + pattern + "\\b"; 101 | } 102 | var re = new RegExp(pattern, flag); 103 | 104 | return this.each(function () { 105 | jQuery.highlight(this, re, settings.element, settings.className); 106 | }); 107 | }; 108 | 109 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Regular; 3 | src: url(../fonts/Regular-Semibold.woff) format("woff"); 4 | font-weight: weight; 5 | font-style: normal; 6 | font-stretch: normal; 7 | } 8 | 9 | 10 | @font-face { 11 | font-family: AtlasGroteskRegular; 12 | src: url(../fonts/AtlasGrotesk-Regular-Web.woff) format("woff"); 13 | font-weight: weight; 14 | font-style: normal; 15 | font-stretch: normal; 16 | } 17 | 18 | 19 | @import url('//fonts.googleapis.com/css?family=Space+Mono'); 20 | 21 | @import url('https://fonts.googleapis.com/icon?family=Material+Icons'); -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_header.scss: -------------------------------------------------------------------------------- 1 | .header-container { 2 | display: block; 3 | left: 0; 4 | transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1); 5 | } 6 | 7 | #header { 8 | &.open { 9 | left: 230px; 10 | } 11 | position: fixed; 12 | top: 0; 13 | left: 0; 14 | transition: left 300ms cubic-bezier(0.4, 0, 0.2, 1); 15 | width: 100vw; 16 | height: $header-height; 17 | z-index: 4; 18 | display: flex; 19 | flex-direction: row; 20 | align-items: flex-start; 21 | } 22 | 23 | 24 | .header-link a { 25 | color: #333; 26 | transition: color .4s ease; 27 | &:hover { 28 | color: #11a08c; 29 | } 30 | } 31 | 32 | // .header-border-top { 33 | // border-top: 1px solid #ccc; 34 | // margin-right: 50%; 35 | // margin-top: 3em; 36 | // } 37 | 38 | // .header-border-bottom { 39 | // border-bottom: 1px solid #ccc; 40 | // margin-right: 50%; 41 | // margin-bottom: 2em; 42 | // } 43 | 44 | @media (max-width: 1024px) { 45 | .header-border-top, .header-border-bottom { 46 | margin-right: 0; 47 | } 48 | } 49 | 50 | .header { 51 | padding: .5em 0; 52 | display: block; 53 | margin: 0; 54 | font-weight: 700; 55 | } 56 | 57 | #menu-button { 58 | display: none; 59 | } 60 | 61 | @media (max-width: $phone-width) { 62 | #menu-button { 63 | display: block; 64 | &.open { 65 | left: 230px; 66 | } 67 | } 68 | } 69 | 70 | .main-header-bg { 71 | background: linear-gradient(to right, #38ea92 0%, #a1def0 100%); 72 | } 73 | 74 | .main-header-menu-button { 75 | cursor: pointer; 76 | background: none; 77 | outline: none; 78 | border: none; 79 | width: 40px; 80 | height: 40px; 81 | padding: 24px 0; 82 | margin-left: 20px; 83 | color: rgba(0, 0, 0, 0.54); 84 | } 85 | 86 | .main-header-logo { 87 | font-family: 'Regular', sans-serif; 88 | display: inline-block; 89 | position: relative; 90 | padding-left: 25px; 91 | font-size: 1.6em; 92 | letter-spacing: -.25px; 93 | cursor: pointer; 94 | } 95 | 96 | .logotype { 97 | font-family: 'Regular', sans-serif; 98 | color: #4d4d4d; 99 | text-decoration: none; 100 | font-size: 1.5em; 101 | } 102 | 103 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_icon-font.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'slate'; 3 | src: url('../fonts/slate.eot?-syv14m'); 4 | src: url('../fonts/slate.eot?#iefix-syv14m') format('embedded-opentype'), 5 | url('../fonts/slate.woff2?-syv14m') format('woff2'), 6 | url('../fonts/slate.woff?-syv14m') format('woff'), 7 | url('../fonts/slate.ttf?-syv14m') format('truetype'), 8 | url('../fonts/slate.svg?-syv14m#slate') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | %icon { 14 | font-family: 'slate'; 15 | speak: none; 16 | font-style: normal; 17 | font-weight: normal; 18 | font-variant: normal; 19 | text-transform: none; 20 | line-height: 1; 21 | } 22 | 23 | %icon-exclamation-sign { 24 | @extend %icon; 25 | content: "\e600"; 26 | } 27 | %icon-info-sign { 28 | @extend %icon; 29 | content: "\e602"; 30 | } 31 | %icon-ok-sign { 32 | @extend %icon; 33 | content: "\e606"; 34 | } 35 | %icon-search { 36 | @extend %icon; 37 | content: "\e607"; 38 | } 39 | 40 | %material-icon { 41 | font-family: 'Material Icons'; 42 | font-weight: normal; 43 | font-style: normal; 44 | font-size: 24px; 45 | line-height: 1; 46 | letter-spacing: normal; 47 | text-transform: none; 48 | display: inline-block; 49 | white-space: nowrap; 50 | word-wrap: normal; 51 | direction: ltr; 52 | -webkit-font-feature-settings: 'liga'; 53 | -webkit-font-smoothing: antialiased; 54 | } 55 | 56 | %aside-icon { 57 | vertical-align: middle; 58 | padding-right: 0.5em; 59 | } 60 | 61 | %icon-info { 62 | @extend %aside-icon; 63 | @extend %material-icon; 64 | content: "\E88E"; 65 | } 66 | %icon-error { 67 | @extend %aside-icon; 68 | @extend %material-icon; 69 | content: "\E000"; 70 | } 71 | %icon-check-circle { 72 | @extend %aside-icon; 73 | @extend %material-icon; 74 | content: "\E86C"; 75 | } 76 | %icon-help { 77 | @extend %aside-icon; 78 | @extend %material-icon; 79 | content: "\E887"; 80 | } 81 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_lazyload.scss: -------------------------------------------------------------------------------- 1 | .figure-container { 2 | max-width: 75%; 3 | margin: auto; 4 | 5 | &.img-m { 6 | max-width: 50%; 7 | } 8 | 9 | &.img-s { 10 | max-width: 40%; 11 | } 12 | 13 | &.img-xs { 14 | max-width: 18%; 15 | } 16 | } 17 | 18 | .Grid--1of3>.Grid-cell { 19 | .figure-container { 20 | max-width: 100%; 21 | } 22 | } 23 | 24 | // images in grid containers 25 | .Grid-cell--1of2 { 26 | .figure-container { 27 | &.img-m { 28 | width: 250px; 29 | } 30 | } 31 | } 32 | 33 | .Grid--1of3>.Grid-cell { 34 | .figure-container { 35 | width: 165px; 36 | } 37 | } 38 | 39 | // containers 40 | .lazy-img { 41 | margin: auto; 42 | overflow: hidden; 43 | } 44 | 45 | .ratio-box { 46 | position: relative; 47 | height: 0; 48 | display: block; 49 | } 50 | 51 | .ratio-box img, 52 | .ratio-box iframe, 53 | .ratio-box video { 54 | position: absolute; 55 | top: 0; 56 | left: 0; 57 | width: 100%; 58 | height: 100%; 59 | display: block; 60 | } 61 | 62 | .img-small { 63 | filter: blur(25px); 64 | transform: scale(1); 65 | } 66 | 67 | .img-small.lazyloaded { 68 | filter: blur(0); 69 | transform: scale(1); 70 | } 71 | 72 | .img-large { 73 | opacity: 0; 74 | } 75 | 76 | .img-large.lazyloaded { 77 | opacity: 1; 78 | transition: opacity .1s linear; 79 | } 80 | 81 | 82 | @media (max-width: $phone-width) { 83 | .figure-container { 84 | max-width: 70%; 85 | } 86 | 87 | .Grid--1of3>.Grid-cell { 88 | .figure-container { 89 | max-width: 65%; 90 | // min-width: 230px; 91 | } 92 | } 93 | .figure-container { 94 | 95 | &.img-m { 96 | max-width: 56%; 97 | // min-width: 250px; 98 | } 99 | 100 | &.img-s { 101 | max-width: 45%; 102 | } 103 | 104 | &.img-xs { 105 | max-width: 20%; 106 | } 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_plyr-mixins.scss: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // Plyr mixins 3 | // https://github.com/selz/plyr 4 | // ========================================================================== 5 | 6 | // styling 7 | @mixin plyr-range-track() { 8 | height: $plyr-range-track-height; 9 | background: transparent; 10 | border: 0; 11 | border-radius: ($plyr-range-track-height / 2); 12 | user-select: none; 13 | } 14 | @mixin plyr-range-thumb() { 15 | position: relative; 16 | height: $plyr-range-thumb-height; 17 | width: $plyr-range-thumb-width; 18 | background: $plyr-range-thumb-bg; 19 | border: $plyr-range-thumb-border; 20 | border-radius: 100%; 21 | transition: background .2s ease, border .2s ease, transform .2s ease; 22 | box-shadow: $plyr-range-thumb-shadow; 23 | box-sizing: border-box; 24 | } 25 | @mixin plyr-range-thumb-active() { 26 | background: $plyr-range-thumb-active-bg; 27 | border-color: $plyr-range-thumb-active-border-color; 28 | transform: scale($plyr-range-thumb-active-scale); 29 | } -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_plyr-variables.scss: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // Plyr variables 3 | // https://github.com/selz/plyr 4 | // https://robots.thoughtbot.com/sass-default 5 | // ========================================================================== 6 | 7 | // Settings 8 | $plyr-border-box: true !default; 9 | $plyr-touch-action: true !default; 10 | $plyr-sr-only-important: true !default; 11 | 12 | // Colors 13 | $plyr-color-main: #3498db !default; 14 | 15 | // Font sizes 16 | $plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif !default; 17 | $plyr-font-size-small: 14px !default; 18 | $plyr-font-size-base: 16px !default; 19 | 20 | // Captions 21 | $plyr-captions-bg: transparentize(#000, .3) !default; 22 | $plyr-captions-color: #fff !default; 23 | $plyr-font-size-captions-base: $plyr-font-size-base !default; 24 | $plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default; 25 | $plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default; 26 | 27 | // Controls 28 | $plyr-control-icon-size: 18px !default; 29 | $plyr-control-spacing: 10px !default; 30 | $plyr-control-padding: ($plyr-control-spacing * .7) !default; 31 | $plyr-video-controls-bg: #000 !default; 32 | $plyr-video-control-color: rgba(0,0,0,0.3) !default; 33 | $plyr-video-control-color-hover: #fff !default; 34 | $plyr-video-control-bg-hover: rgba(0,0,0,0.7) !default; 35 | $plyr-audio-controls-bg: #fff !default; 36 | $plyr-audio-controls-border: 1px solid #dbe3e8 !default; 37 | $plyr-audio-control-color: #565D64 !default; 38 | $plyr-audio-control-color-hover: #fff !default; 39 | $plyr-audio-control-bg-hover: $plyr-color-main; 40 | 41 | // Tooltips 42 | $plyr-tooltip-bg: transparentize(#000, .3) !default; 43 | $plyr-tooltip-color: #fff !default; 44 | $plyr-tooltip-padding: ($plyr-control-spacing / 2) !default; 45 | $plyr-tooltip-arrow-size: 4px !default; 46 | $plyr-tooltip-radius: 3px !default; 47 | 48 | // Progress 49 | $plyr-progress-loading-size: 25px !default; 50 | $plyr-progress-loading-bg: transparentize(#000, .85) !default; 51 | $plyr-video-progress-bg: transparentize(#fff, .75) !default; 52 | $plyr-video-progress-buffered-bg: $plyr-video-progress-bg !default; 53 | $plyr-audio-progress-bg: transparentize(#C6D6DB, .33) !default; 54 | $plyr-audio-progress-buffered-bg: $plyr-audio-progress-bg !default; 55 | 56 | // Range sliders 57 | $plyr-range-track-height: 8px !default; 58 | $plyr-range-thumb-height: floor($plyr-range-track-height * 2) !default; 59 | $plyr-range-thumb-width: floor($plyr-range-track-height * 2) !default; 60 | $plyr-range-thumb-bg: #fff !default; 61 | $plyr-range-thumb-border: 2px solid transparent !default; 62 | $plyr-range-thumb-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85), 0 0 0 1px transparentize(#000, .85) !default; 63 | $plyr-range-thumb-active-border-color: #fff !default; 64 | $plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default; 65 | $plyr-range-thumb-active-scale: 1.25 !default; 66 | $plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default; 67 | $plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default; 68 | $plyr-range-selected-bg: $plyr-color-main !default; 69 | 70 | // Breakpoints 71 | $plyr-bp-screen-sm: 480px !default; 72 | $plyr-bp-screen-md: 768px !default; 73 | $plyr-bp-screen-lg: 1024px !default; -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_site.scss: -------------------------------------------------------------------------------- 1 | .site { 2 | overflow-y:scroll; 3 | } 4 | 5 | .docs { 6 | position: relative; 7 | width: 100%; 8 | height: 100%; 9 | } 10 | 11 | .docs-body { 12 | position: absolute; 13 | top: 0; 14 | right: 0; 15 | left: 0; 16 | bottom: 0; 17 | overflow-y: auto; 18 | color: #000; 19 | background: #fff; 20 | transition: left 250ms ease 0ms; 21 | } 22 | 23 | .site-transform { 24 | margin-top: -90px; 25 | } 26 | 27 | .site-content-container { 28 | max-width: 1700px; 29 | margin: 0 auto; 30 | padding: 0 60px; 31 | } 32 | 33 | 34 | .content { 35 | a { 36 | cursor: pointer; 37 | font-weight: 500; 38 | text-decoration: none; 39 | color: $a-links; 40 | } 41 | h4 { 42 | cursor: auto; 43 | text-decoration: none; 44 | } 45 | } 46 | 47 | 48 | h2,h3 { 49 | .anchor, 50 | .github-edit { 51 | color: lightgray; 52 | padding: 0em 0em 0em 0.5em; 53 | font-size: 24px; 54 | } 55 | } 56 | 57 | 58 | h1 { 59 | .anchor, 60 | .github-edit { 61 | color: #868686; 62 | padding: 0em 0em 0em 0.5em; 63 | font-size: 28px; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2008-2013 Concur Technologies, Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); you may 5 | not use this file except in compliance with the License. You may obtain 6 | a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | License for the specific language governing permissions and limitations 14 | under the License. 15 | */ 16 | 17 | 18 | //////////////////////////////////////////////////////////////////////////////// 19 | // CUSTOMIZE SLATE 20 | //////////////////////////////////////////////////////////////////////////////// 21 | // Use these settings to help adjust the appearance of Slate 22 | 23 | 24 | // BACKGROUND COLORS 25 | //////////////////// 26 | $nav-bg: #f5f5f5 !default; 27 | $examples-bg: #f1f1f1 !default; 28 | $code-bg: #292929 !default; 29 | $code-annotation-bg: #1c1c1c !default; 30 | $nav-subitem-bg: #ccc !default; 31 | $nav-active-bg: #616161 !default; 32 | $lang-select-border: #000 !default; 33 | $lang-select-bg: #222 !default; 34 | $lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something 35 | $lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed 36 | $main-bg: #ffffff !default; 37 | $aside-bg: #eeeeee !default; 38 | $aside-notice-border: #90caf9 !default; 39 | $aside-warning-border: #ef5350 !default; 40 | $aside-success-border: #9ccc65 !default; 41 | $aside-faq-border: #37474F !default; 42 | $search-notice-bg: #c97a7e !default; 43 | $search-bg: #ccc !default; 44 | $nav-subheader-bg: #E0E0E0 !default; 45 | $nav-subh3-bg: #9E9E9E !default; 46 | $a-links: #00ACC1 !default; 47 | 48 | // TEXT COLORS 49 | //////////////////// 50 | $main-text: #333 !default; // main content text color 51 | $nav-text: #424242 !default; 52 | $nav-active-text: #fff !default; 53 | $lang-select-text: #fff !default; // color of unselected language tab text 54 | $lang-select-active-text: #fff !default; // color of selected language tab text 55 | $lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed 56 | $aside-text: #212121 !default; // aside text color 57 | 58 | 59 | // SIZES 60 | //////////////////// 61 | $nav-width: 230px !default; // width of the navbar 62 | $examples-width: 50% !default; // portion of the screen taken up by code examples 63 | $logo-margin: 20px !default; // margin between nav items and logo, ignored if search is active 64 | $main-padding: 30px !default; // padding to left and right of content & examples 65 | $nav-padding: 15px !default; // padding to left and right of navbar 66 | $nav-v-padding: 10px !default; // padding used vertically around search boxes and results 67 | $nav-indent: 10px !default; // extra padding for ToC subitems 68 | $code-annotation-padding: 13px !default; // padding inside code annotations 69 | $h1-margin-bottom: 21px !default; // padding under the largest header tags 70 | $phone-width: 768px !default; // min width before reverting to tablet size 71 | $laptop-width: 1024px !default; // min width before reverting to mobile size 72 | $max-content-width: 1440px !default; //max width of the content section 73 | 74 | 75 | // FONTS 76 | //////////////////// 77 | %default-font { 78 | font-family: "AtlasGroteskRegular", Helvetica, Arial, sans-serif; 79 | font-size: 14px; 80 | } 81 | 82 | %header-font { 83 | font-family: "Regular", Helvetica, Arial, sans-serif; 84 | font-weight: bold; 85 | } 86 | 87 | %code-font { 88 | font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif; 89 | font-size: 12px; 90 | line-height: 1.5; 91 | } 92 | 93 | 94 | // FONT-SIZES 95 | //////////////////// 96 | $h1-size: 2.4em !default; 97 | $h2-size: 2em !default; 98 | $h3-size: 1.6em !default; 99 | $h4-size: 1.2em !default; 100 | $h5-size: 1em !default; 101 | 102 | // OTHER 103 | //////////////////// 104 | $nav-active-shadow: #000 !default; 105 | $nav-footer-border-color: #666 !default; 106 | $nav-embossed-border-top: #000 !default; 107 | $nav-embossed-border-bottom: #939393 !default; 108 | $main-embossed-text-shadow: 0px 1px 0px #fff !default; 109 | $search-box-border-color: #666 !default; 110 | 111 | $header-height: 50px; 112 | 113 | //////////////////////////////////////////////////////////////////////////////// 114 | // INTERNAL 115 | //////////////////////////////////////////////////////////////////////////////// 116 | // These settings are probably best left alone. 117 | 118 | %break-words { 119 | word-break: break-word; 120 | hyphens: auto; 121 | } 122 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/static/slate/stylesheets/monokai.scss: -------------------------------------------------------------------------------- 1 | .highlight pre { background-color: #272822; } 2 | .highlight .hll { background-color: #272822; } 3 | .highlight .c { color: #75715e } /* Comment */ 4 | .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ 5 | .highlight .k { color: #66d9ef } /* Keyword */ 6 | .highlight .l { color: #ae81ff } /* Literal */ 7 | .highlight .n { color: #f8f8f2 } /* Name */ 8 | .highlight .o { color: #f92672 } /* Operator */ 9 | .highlight .p { color: #f8f8f2 } /* Punctuation */ 10 | .highlight .cm { color: #75715e } /* Comment.Multiline */ 11 | .highlight .cp { color: #75715e } /* Comment.Preproc */ 12 | .highlight .c1 { color: #75715e } /* Comment.Single */ 13 | .highlight .cs { color: #75715e } /* Comment.Special */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 16 | .highlight .kc { color: #66d9ef } /* Keyword.Constant */ 17 | .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ 18 | .highlight .kn { color: #f92672 } /* Keyword.Namespace */ 19 | .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ 20 | .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ 21 | .highlight .kt { color: #66d9ef } /* Keyword.Type */ 22 | .highlight .ld { color: #e6db74 } /* Literal.Date */ 23 | .highlight .m { color: #ae81ff } /* Literal.Number */ 24 | .highlight .s { color: #e6db74 } /* Literal.String */ 25 | .highlight .na { color: #a6e22e } /* Name.Attribute */ 26 | .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ 27 | .highlight .nc { color: #a6e22e } /* Name.Class */ 28 | .highlight .no { color: #66d9ef } /* Name.Constant */ 29 | .highlight .nd { color: #a6e22e } /* Name.Decorator */ 30 | .highlight .ni { color: #f8f8f2 } /* Name.Entity */ 31 | .highlight .ne { color: #a6e22e } /* Name.Exception */ 32 | .highlight .nf { color: #a6e22e } /* Name.Function */ 33 | .highlight .nl { color: #f8f8f2 } /* Name.Label */ 34 | .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ 35 | .highlight .nx { color: #a6e22e } /* Name.Other */ 36 | .highlight .py { color: #f8f8f2 } /* Name.Property */ 37 | .highlight .nt { color: #f92672 } /* Name.Tag */ 38 | .highlight .nv { color: #f8f8f2 } /* Name.Variable */ 39 | .highlight .ow { color: #f92672 } /* Operator.Word */ 40 | .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ 41 | .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ 42 | .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #e6db74 } /* Literal.String.Char */ 47 | .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ 49 | .highlight .se { color: #ae81ff } /* Literal.String.Escape */ 50 | .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #e6db74 } /* Literal.String.Other */ 53 | .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ 55 | .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ 61 | 62 | .highlight .gh { } /* Generic Heading & Diff Header */ 63 | .highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ 64 | .highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ 65 | .highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ 66 | -------------------------------------------------------------------------------- /site/themes/nathakit_docuapi/theme.toml: -------------------------------------------------------------------------------- 1 | name = "DocuAPI" 2 | license = "Apache-2.0" 3 | licenselink = "https://github.com/bep/docuapi/blob/master/LICENSE.md" 4 | description = "Beautiful documentation for your API." 5 | homepage = "http://docuapi.com/" 6 | tags = ["Documentation", "API", "Docs", "Responsive", "Multilingual"] 7 | features = ["Documentation", "Multilingual"] 8 | min_version = 0.17 9 | 10 | [author] 11 | name = "Bjørn Erik Pedersen" 12 | homepage = "http://bep.is" 13 | 14 | [original] 15 | name = "Slate" 16 | homepage = "https://github.com/lord/slate" 17 | repo = "https://github.com/lord/slate" 18 | -------------------------------------------------------------------------------- /src/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # required libraries 4 | 5 | # args 6 | # filepath 7 | # http-client 8 | # intarweb 9 | # linenoise 10 | # medea 11 | # message-digest 12 | # sha2 13 | # shell 14 | # simple-exceptions 15 | # simple-loops 16 | # spiffy 17 | # spiffy-request-vars 18 | # uri-common 19 | 20 | 21 | VERSION="dev_version" 22 | if [ "$1" != "" ]; then 23 | VERSION=$1 24 | perl -pi -e "s/VERSION_NUMBER_HERE/$1/" pc.scm 25 | perl -pi -e "s/VERSION_NUMBER_HERE/$1/" private_comments.scm 26 | fi 27 | 28 | echo "Building libraries for $VERSION" 29 | 30 | csc -static -unit masutils -cJ masutils.scm 31 | csc -static -unit masufiles -cJ masufiles.scm 32 | csc -static -unit masurequests -cJ masurequests.scm 33 | csc -static -unit pathname-expand -cJ pathname-expand.scm 34 | csc -static -unit comment-recording -cJ comment-recording.scm 35 | csc -static -unit listicles -cJ listicles.scm 36 | 37 | echo "Building private_comments executable..." 38 | 39 | csc -link masutils \ 40 | -link masufiles \ 41 | -link pathname-expand \ 42 | -static private_comments.scm 43 | 44 | 45 | echo "Building pc executable..." 46 | 47 | csc -link comment-recording \ 48 | -link listicles \ 49 | -link masufiles \ 50 | -link masurequests \ 51 | -link masutils \ 52 | -static pc.scm 53 | 54 | 55 | if [ "$1" != "" ]; then 56 | perl -pi -e "s/$1/VERSION_NUMBER_HERE/" pc.scm 57 | perl -pi -e "s/$1/VERSION_NUMBER_HERE/" private_comments.scm 58 | fi 59 | readonly OS="$(uname)" 60 | readonly ARCHITECTURE=$(arch) 61 | readonly version_dir="../bin/private_comments_${OS}_${ARCHITECTURE}_${VERSION}" 62 | echo "creating compressed release file..." 63 | echo " $version_dir.tgz" 64 | rm -rf $version_dir 65 | mkdir $version_dir 66 | cp private_comments $version_dir/ 67 | cp pc $version_dir/ 68 | 69 | # move them to the bin directory so that 70 | # you have a dir you can add to your path 71 | # that always has the latest executable in it 72 | mkdir -p ../bin 73 | mv private_comments ../bin/ 74 | mv pc ../bin/ 75 | 76 | # compress it 77 | tar -czf $version_dir.tgz $version_dir 78 | rm -rf $version_dir 79 | 80 | echo "here's your SHA for homebrew" 81 | shasum -a 256 $version_dir.tgz 82 | 83 | function print_dlibs() { 84 | binary=$1 85 | echo "DLIBS used by $binary:" 86 | 87 | DYLIBS=`otool -L $binary | grep "/opt" | awk -F' ' '{ print $1 }'` 88 | if [ "$DYLIBS" == "" ]; then 89 | echo " None!" 90 | else 91 | for dylib in $DYLIBS 92 | do 93 | echo " - dylib $dylib" 94 | done 95 | fi 96 | } 97 | 98 | echo "====================" 99 | 100 | if [[ "${OS}" == "Darwin" ]]; then 101 | print_dlibs "../bin/private_comments" 102 | print_dlibs "../bin/pc" 103 | fi 104 | 105 | echo "====================" 106 | echo "Done." 107 | 108 | -------------------------------------------------------------------------------- /src/clean.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | set -x 3 | 4 | # Cleans up the build artifacts 5 | # Run in the top level directory. 6 | 7 | rm -vfr *.o *.link 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/comment-recording.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; comment-recording.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'comment-recording 7 | 'comment-recording 8 | (scheme#list) 9 | '((post-or-delete-comment . comment-recording#post-or-delete-comment) 10 | (prep-comment-info-alist . comment-recording#prep-comment-info-alist)) 11 | (scheme#list) 12 | (scheme#list)))) 13 | 14 | ;; END OF FILE 15 | -------------------------------------------------------------------------------- /src/comment-recording.scm: -------------------------------------------------------------------------------- 1 | (module comment-recording 2 | ( 3 | post-or-delete-comment 4 | prep-comment-info-alist 5 | ) 6 | 7 | (import scheme) 8 | (import chicken.base) 9 | (import chicken.format) 10 | (import chicken.io) 11 | (import chicken.string) 12 | (import simple-exceptions) 13 | (import shell) 14 | (import medea) 15 | (import masutils) 16 | (import masurequests) 17 | (import srfi-13) 18 | 19 | (define (get-user-info) 20 | (list 21 | (cons 'user-email (string-translate* 22 | (capture "git config --get user.email") 23 | '(("\n" . "")))) 24 | (cons 'user-name (string-translate* 25 | (capture "git config --get user.name") 26 | '(("\n" . "")))))) 27 | 28 | ; generates the following JSON and posts it to the private comments server 29 | ; { 30 | ; project_name_hash: "", 31 | ; file_patH_hash: "", 32 | ; line_number: "", 33 | ; treeish: "", 34 | ; comment: "", 35 | ; user_name: "", // optional 36 | ; user_email: "", // optional 37 | ; } 38 | 39 | (define (prep-comment-info-alist 40 | line-number 41 | line-treeish-map 42 | comment 43 | user-info 44 | server-info) 45 | 46 | (if (null? user-info) 47 | (set! user-info (get-user-info))) 48 | 49 | (let ((treeish 50 | (alist-ref line-number line-treeish-map))) 51 | (if (and (not (null? treeish)) (!= treeish "00000000")) 52 | (begin 53 | (list 54 | (cons 'project_name_hash (alist-ref 'project-name-hash server-info)) 55 | (cons 'file_path_hash (alist-ref 'file-path-hash server-info)) 56 | (cons 'treeish treeish) 57 | (cons 'line_number line-number) 58 | (cons 'user_name (alist-ref 'user-name user-info)) 59 | (cons 'user_email (alist-ref 'user-email user-info)) 60 | (cons 'comment comment) 61 | )) 62 | (begin 63 | (format (current-error-port) 64 | "Line ~A has not been committed yet. I can't act on uncommitted lines.~%" 65 | line-number) 66 | '())))) 67 | 68 | (define (post-or-delete-comment data pc-url post-or-delete) 69 | ; TODO Implement better handling of comments on uncommitted lines 70 | ; SHORT TERM: bail if that line isn't committed 71 | ; LONG TERM: store it in a temp file 72 | ; and wait for the commit before sending it. 73 | 74 | ; bail early for uncommitted line... 75 | (if (null? (alist-ref 'treeish data)) 76 | (format (current-error-port) 77 | "Line ~A has not been committed yet. Please commit it before commenting.~%" 78 | (alist-ref 'line_number data))) 79 | 80 | 81 | (if (equal? post-or-delete 'POST) 82 | (post-or-die 83 | pc-url 84 | (json->string data) 85 | (sprintf 86 | "Failed to create on Private Comments server at: ~A~% ~~A~%Is it running?~%" 87 | pc-url)) 88 | (delete-or-die 89 | pc-url 90 | (sprintf 91 | "Failed to delete from Private Comments server at: ~A~% ~~A~%Is it running?~%" 92 | pc-url) 93 | ))) 94 | ) 95 | 96 | -------------------------------------------------------------------------------- /src/file-repo.scm: -------------------------------------------------------------------------------- 1 | (import chicken.format) 2 | (import chicken.file) 3 | (import chicken.io) 4 | (import srfi-13) 5 | (import masufiles) 6 | (import coops) 7 | 8 | (define-class () 9 | ( 10 | (file-path "UNKNOWN") 11 | (git-repo-root "UNKNOWN") ; set in initializer 12 | (project-name "UNKNOWN") ; set in initializer 13 | )) 14 | 15 | 16 | (define-method (initialize-instance (fr )) 17 | (call-next-method) 18 | (let ((git-output (capture "git rev-parse --show-toplevel")) ) 19 | (if (not (string? git-output)) 20 | (begin 21 | (format (current-error-port) "Must be run from within a git repository") 22 | (exit 2)) 23 | (set! (slot-value fr 'git-repo-root) (string-trim-both git-output)))) 24 | (set! (slot-value fr 'project-name) 25 | (last (path->list (slot-value fr 'git-repo-root)))) ) 26 | 27 | ; converts ./foo to foo and ../bar/foo to bar/foo 28 | ; and ../bar/../bar/foo to bar/bar/foo which would be bad, but 29 | ; there's only so much cleaning I'm willing to do with your 30 | ; crazy input people. 31 | ; Sheesh. 32 | (define-method (fr-file-path-list (fr )) 33 | (filter 34 | (lambda (elem) (not (or (equal? "." elem) (equal? ".." elem)) )) 35 | (path->list (slot-value fr 'file-path)))) 36 | 37 | (define-method (fr-file-path (fr path 39 | fr-file-path-list)) 40 | 41 | (define-method (fr-repo-file-path (fr )) 42 | (list->path 43 | (append 44 | (list directory-separator-string) 45 | (path->list (slot-value fr 'git-repo-root)) 46 | fr-file-path-list))) 47 | 48 | (define-method (fr-file-exists? (fr )) 49 | (file-exists? (fr-repo-file-path fr))) 50 | 51 | (define-method (fr-known-file? (fr )) 52 | (let ((git-output 53 | (capture 54 | (sprintf 55 | "git ls-files --error-unmatch ~A" 56 | (fr-file-path fr)))) ) 57 | (if (string? git-output) #t #f))) 58 | 59 | (define-method (valid-or-die (fr )) 60 | (if (not (fr-file-exists? fr)) 61 | (begin 62 | (format (current-error-port) 63 | "Unable to find ~A~%" (fr-repo-file-path fr) 64 | ) 65 | (exit 3))) 66 | (if (not (fr-known-file? fr)) 67 | (begin 68 | (format (current-error-port) 69 | "File is not currently tracked by git: ~A~%" 70 | (fr-repo-file-path fr)) 71 | (exit 4))) 72 | 73 | ;TODO handle other invalidities 74 | #t ; valid! 75 | ) 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/install_chicken_eggs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # makes sure all the required chicken scheme eggs 4 | # are installed 5 | echo "Will run chicken-install for required eggs (libraries)" 6 | 7 | 8 | chicken-install args 9 | chicken-install filepath 10 | chicken-install format 11 | chicken-install http-client 12 | chicken-install intarweb 13 | chicken-install linenoise 14 | chicken-install medea 15 | chicken-install message-digest 16 | chicken-install sha2 17 | chicken-install shell 18 | chicken-install simple-exceptions 19 | chicken-install simple-loops 20 | chicken-install spiffy 21 | chicken-install spiffy-request-vars 22 | chicken-install uri-common 23 | 24 | echo "DONE" 25 | -------------------------------------------------------------------------------- /src/listicles.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; listicles.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'listicles 7 | 'listicles 8 | (scheme#list) 9 | '((convert-rows-to-cols . listicles#convert-rows-to-cols) 10 | (list-by-index . listicles#list-by-index) 11 | (last-index . listicles#last-index) 12 | (list-includes . listicles#list-includes) 13 | (mflatten . listicles#mflatten) 14 | (nth . listicles#nth) 15 | (pairs-list-to-hash . listicles#pairs-list-to-hash) 16 | (range . listicles#range) 17 | (replace-nth . listicles#replace-nth) 18 | (sort-strings< . listicles#sort-strings<) 19 | (sort-strings> . listicles#sort-strings>) 20 | (split-by . listicles#split-by)) 21 | (scheme#list) 22 | (scheme#list)))) 23 | 24 | ;; END OF FILE 25 | -------------------------------------------------------------------------------- /src/masufiles.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; masufiles.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'masufiles 7 | 'masufiles 8 | (scheme#list) 9 | '((list->path . masufiles#list->path) 10 | (path->list . masufiles#path->list) 11 | (read-file-contents . masufiles#read-file-contents) 12 | (directory-separator-string . masufiles#directory-separator-string) 13 | (string->file . masufiles#string->file) 14 | (file->string . masufiles#file->string)) 15 | (scheme#list) 16 | (scheme#list)))) 17 | 18 | ;; END OF FILE 19 | -------------------------------------------------------------------------------- /src/masufiles.scm: -------------------------------------------------------------------------------- 1 | (module masufiles 2 | ( 3 | list->path 4 | path->list 5 | read-file-contents 6 | directory-separator-string 7 | string->file 8 | file->string 9 | ) 10 | (import scheme) 11 | (import srfi-13) 12 | (import filepath) 13 | (import chicken.string) 14 | (import chicken.io) 15 | 16 | ;debugging only 17 | (import chicken.base) 18 | (import chicken.format) 19 | (import srfi-28) 20 | (import pathname-expand) 21 | 22 | (define directory-separator-string 23 | (make-string 1 (filepath:path-separator))) 24 | 25 | (define (list->path a-list) 26 | (string-join 27 | a-list 28 | directory-separator-string)) 29 | 30 | (define (path->list path) 31 | (string-split 32 | path 33 | directory-separator-string)) 34 | 35 | ; returns a string containing the contents 36 | ; of the file at the specified file path 37 | ; TODO: check if file exists 38 | (define (read-file-contents file-path) 39 | (let ((file-contents "")) 40 | (let ((fh (open-input-file file-path))) 41 | (let loop((c (read-line fh))) 42 | (if (eof-object? c) 43 | (close-input-port fh) 44 | (begin 45 | (set! file-contents 46 | (string-append file-contents c)) 47 | (loop (read-line fh))))) ) 48 | file-contents)) 49 | 50 | (define (file->string file-path) 51 | (read-file-contents file-path)) 52 | 53 | (define (string->file a-string file-path) 54 | (format (current-error-port) "XXX asked to write string to ~A~%" file-path) 55 | (define output-file-port 56 | (open-output-file 57 | (pathname-expand file-path))) 58 | (display a-string output-file-port) 59 | (close-output-port output-file-port)) 60 | ) 61 | -------------------------------------------------------------------------------- /src/masurequests.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; masurequests.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'masurequests 7 | 'masurequests 8 | (scheme#list) 9 | '((delete-or-die . masurequests#delete-or-die) 10 | (get-or-die . masurequests#get-or-die) 11 | (post-or-die . masurequests#post-or-die) 12 | (put-or-die . masurequests#put-or-die) 13 | (request-or-die . masurequests#request-or-die)) 14 | (scheme#list) 15 | (scheme#list)))) 16 | 17 | ;; END OF FILE 18 | -------------------------------------------------------------------------------- /src/masurequests.scm: -------------------------------------------------------------------------------- 1 | (module masurequests 2 | ( 3 | delete-or-die 4 | get-or-die 5 | post-or-die 6 | put-or-die 7 | request-or-die 8 | ) 9 | 10 | (import scheme) 11 | (import chicken.base) 12 | (import chicken.condition) 13 | (import format) 14 | (import chicken.io) 15 | (import uri-common) 16 | (import intarweb) 17 | (import http-client) 18 | (import simple-exceptions) 19 | 20 | ; see https://api.call-cc.org/4/doc/http-client 21 | ; for docs on with-input-from-request 22 | 23 | 24 | (define (delete-or-die url error-message-with-param) 25 | (request-or-die url #f 'DELETE error-message-with-param)) 26 | 27 | (define (get-or-die url error-message-with-param) 28 | (request-or-die url #f 'GET error-message-with-param)) 29 | 30 | (define (post-or-die url data-string error-message-with-param) 31 | (request-or-die url data-string 'POST error-message-with-param)) 32 | 33 | 34 | (define (put-or-die url data-string error-message-with-param) 35 | (request-or-die url data-string 'PUT error-message-with-param)) 36 | 37 | (define (request-or-die 38 | url 39 | data-string ; alist or #f 40 | request-type ; 'GET, 'PUT, 'POST, 'DELETE, 'HEAD 41 | error-message-with-param 42 | ) 43 | (guard 44 | (e 45 | (else 46 | (begin 47 | (format 48 | (current-error-port) 49 | error-message-with-param 50 | (condition->list e) ) 51 | (exit 9)))) 52 | (with-input-from-request 53 | (make-request method: request-type ; make-request from intarweb 54 | uri: (uri-reference url)) ; uri-reference from uri-common 55 | data-string ; may be #f 56 | read-string) 57 | )) 58 | 59 | 60 | 61 | 62 | ) 63 | -------------------------------------------------------------------------------- /src/masutils.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; masutils.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'masutils 7 | 'masutils 8 | (scheme#list) 9 | '((== . masutils#==) 10 | (!= . masutils#!=) 11 | (=== . masutils#===) 12 | (!== . masutils#!==) 13 | (boolify . masutils#boolify) 14 | (get-type . masutils#get-type) 15 | (get-type-string . masutils#get-type-string)) 16 | (scheme#list) 17 | (scheme#list)))) 18 | 19 | ;; END OF FILE 20 | -------------------------------------------------------------------------------- /src/masutils.scm: -------------------------------------------------------------------------------- 1 | (module masutils 2 | ( 3 | ; comparison tools 4 | == 5 | != 6 | === 7 | !== 8 | boolify 9 | get-type 10 | get-type-string 11 | ) 12 | 13 | (import chicken.base) 14 | (import scheme) 15 | 16 | (define (== a b) 17 | (equal? a b)) 18 | 19 | (define (!= a b) 20 | (not (== a b))) 21 | 22 | (define (=== a b) 23 | (eq? a b)) 24 | 25 | (define (!== a b) 26 | (not (=== a b))) 27 | 28 | (define (boolify x) 29 | (not (not x))) 30 | 31 | (define (get-type x) 32 | (cond 33 | ((complex? x) 'complex) 34 | ((real? x) 'real) 35 | ((rational? x) 'rational) 36 | ((integer? x) 'integer) 37 | ((number? x) 'number) 38 | ((list? x) 'list) 39 | ((pair? x) 'pair); a pair is a list but a list may not be a pair 40 | ((string? x) 'string) 41 | ((boolean? x) 'boolean) 42 | ((null? x) 'null) 43 | ((symbol? x) 'symbol) 44 | ((char? x) 'character) 45 | ((vector? x) 'vector) 46 | ((procedure? x)'procedure) 47 | ((input-port? x) 'input-port) 48 | ((output-port? x) 'output-port) 49 | ((eof-object? x) 'eof-object) 50 | (else 'unknown))) 51 | 52 | (define (get-type-string x) 53 | (symbol->string (get-type x))) 54 | 55 | ) 56 | 57 | -------------------------------------------------------------------------------- /src/pathname-expand.import.scm: -------------------------------------------------------------------------------- 1 | ;;;; pathname-expand.import.scm - GENERATED BY CHICKEN 5.2.0 -*- Scheme -*- 2 | 3 | (##sys#with-environment 4 | (lambda () 5 | (##sys#register-compiled-module 6 | 'pathname-expand 7 | 'pathname-expand 8 | (scheme#list) 9 | '((pathname-expand . pathname-expand#pathname-expand)) 10 | (scheme#list) 11 | (scheme#list)))) 12 | 13 | ;; END OF FILE 14 | -------------------------------------------------------------------------------- /src/tests/commentless_file.txt: -------------------------------------------------------------------------------- 1 | For the purposes of testing 2 | this is a file that will 3 | never have comments 4 | left on it. 5 | 6 | -------------------------------------------------------------------------------- /src/tests/test_client: -------------------------------------------------------------------------------- 1 | # Testing from the outside in. 2 | # This is going to be a pretty procedural 3 | # and order dependent set of tests. 4 | # I'm using bash_unit https://github.com/pgrange/bash_unit 5 | # to execute them. 6 | 7 | # test that we can launch the server 8 | 9 | # NOTE RE NAMING: 10 | # They're run alphabetically 11 | # 12 | source ./test_suite_management.sh 13 | 14 | test_1_usage_message() { 15 | usage=$($REPO_ROOT/src/pc) 16 | assert_equals 0 $? 17 | } 18 | 19 | # 20 | # # test that it doesn't blow up when there aren't any comments 21 | test_2_no_comments () { 22 | nothing=$($REPO_ROOT/src/pc -f "src/tests/commentless_file.txt") 23 | assert_equals 0 $? "error code returned when retrieving comments" 24 | assert_equals "$nothing" "" "there were unexpected comments in commentless file" 25 | } 26 | 27 | # # test that it lets you create a comment 28 | test_3_new_comment () { 29 | response=$($REPO_ROOT/src/pc -f src/comment-recording.scm -c "my comment" -l 1 2>/dev/null) 30 | assert_equals "" "$response" "pc returned unexpected response when creating comment" 31 | 32 | assert "test -e \"$TEST_COMMENTS_DIR/e928d49542ea19c66589897e0ee7160c09947b0b92d73b029b28d591aeaf5cb4/93569b7b/a5ecf5465d3e93f71e6af298255cd672046ce7424d6019c6586181c1cf82d989-1.json\"" "json file not created" 33 | } 34 | 35 | # test that it lets you retrieve that comment 36 | test_4_comment () { 37 | response=$($REPO_ROOT/src/pc -f src/comment-recording.scm) # Can't specify line 38 | assert_equals "1: my comment" "$response" "unable to retrieve comment" 39 | } 40 | 41 | # test that it lets you delete that comment 42 | test_5_delete_comment () { 43 | response=$($REPO_ROOT/src/pc -d -f src/comment-recording.scm -l 1) 44 | assert_equals "" "$response" "error deleting comment" 45 | assert "test ! -e \"$TEST_COMMENTS_DIR/e928d49542ea19c66589897e0ee7160c09947b0b92d73b029b28d591aeaf5cb4/93569b7b/a5ecf5465d3e93f71e6af298255cd672046ce7424d6019c6586181c1cf82d989-1.json\"" "json file not deleted" 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/tests/test_server: -------------------------------------------------------------------------------- 1 | # Testing from the outside in. 2 | # This is going to be a pretty procedural 3 | # and order dependent set of tests. 4 | # I'm using bash_unit https://github.com/pgrange/bash_unit 5 | # to execute them. 6 | 7 | # test that we can launch the server 8 | 9 | source ./test_suite_management.sh 10 | 11 | # NOTE RE NAMING: 12 | # They're run alphabetically 13 | 14 | # test that the status page works 15 | test_1_status_page () { 16 | 17 | # curl -s http://localhost:5749/status 18 | # I'm not sure why but the command has to be run at least 19 | # once before we can capture it in a var. 20 | # thus the status line in the setup_suite is non-optional 21 | STATUS_JSON=$( curl -s http://localhost:5749/status ) 22 | assert_equals '{"status": "ALIVE"}' "$STATUS_JSON" 23 | 24 | } 25 | # 26 | # # test that it doesn't blow up when there aren't any comments 27 | test_2_no_comments () { 28 | URL="http://localhost:5749/v1/comments?project_name_hash=$PROJECT_NAME_HASH&file_path_hash=$FILE_PATH_HASH&treeishes=$TREEISH_ONE" 29 | COMMENT_JSON=$(curl -s --request GET \ 30 | --url $URL) 31 | assert_equals "{\"project_name_hash\":\"$PROJECT_NAME_HASH\",\"file_path_hash\":\"$FILE_PATH_HASH\",\"comments\":[]}" "$COMMENT_JSON" 32 | } 33 | 34 | # test that it lets you create a comment 35 | test_3_new_comment () { 36 | read -r -d '' NEW_COMMENT_JSON << EOM 37 | { 38 | "project_name_hash": "$PROJECT_NAME_HASH", 39 | "file_path_hash": "$FILE_PATH_HASH", 40 | "treeish": "$TREEISH_ONE", 41 | "line_number": 4, 42 | "comment": "comment text here" 43 | } 44 | EOM 45 | 46 | NEW_COMMENT_RESPONSE=$(curl -s --request POST \ 47 | --url http://localhost:5749/v1/comments \ 48 | --header 'content-type: application/json' \ 49 | --data "$NEW_COMMENT_JSON") 50 | 51 | assert_equals '{"status": "SUCCESS", "description": "41c4765834d1627278775e6b5faa920d98d82dddcae6e4bf66b32de9725b1e00-4.json written"}' "$NEW_COMMENT_RESPONSE" 52 | 53 | assert "test -e \"$TEST_COMMENTS_DIR/pc_testing_test_project_hash/d689d9f4012e2d222cb69bfcb9d0bab2c66f5c7d/41c4765834d1627278775e6b5faa920d98d82dddcae6e4bf66b32de9725b1e00-4.json\"" "json file not created" 54 | } 55 | 56 | # test that it lets you retrieve that comment 57 | test_4_comment () { 58 | URL="http://localhost:5749/v1/comments?project_name_hash=$PROJECT_NAME_HASH&file_path_hash=$FILE_PATH_HASH&treeishes=$TREEISH_ONE" 59 | COMMENT_JSON=$(curl -s --request GET \ 60 | --url $URL) 61 | assert_equals "{\"project_name_hash\":\"$PROJECT_NAME_HASH\",\"file_path_hash\":\"$FILE_PATH_HASH\",\"comments\":[{\"treeish\":\"$TREEISH_ONE\",\"line_number\":4,\"comment\":\"comment text here\"}]}" "$COMMENT_JSON" 62 | } 63 | 64 | # test that it lets you delete that comment 65 | test_5_delete_comment () { 66 | 67 | URL="http://localhost:5749/v1/comments?project_name_hash=$PROJECT_NAME_HASH&file_path_hash=$FILE_PATH_HASH&treeish=$TREEISH_ONE&line_number=4" 68 | 69 | # ^^ singular treeish not treeishes 70 | # URL not JSON because DELETE doesn't support doing anything 71 | # with the message body. All relevant info must be in URL 72 | 73 | 74 | KILL_COMMENT_RESPONSE=$(curl -s -X DELETE $URL ) 75 | 76 | assert_equals '{"status": "SUCCESS", "description": "comment removed"}' "$KILL_COMMENT_RESPONSE" 77 | 78 | assert "test ! -e \"$TEST_COMMENTS_DIR/pc_testing_test_project_hash/d689d9f4012e2d222cb69bfcb9d0bab2c66f5c7d/41c4765834d1627278775e6b5faa920d98d82dddcae6e4bf66b32de9725b1e00-4.json\"" "json file was not deleted" 79 | 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/tests/test_suite_management.sh: -------------------------------------------------------------------------------- 1 | setup_suite () { 2 | # echo "BEGIN SETUP" 3 | # prep the disposable test directory 4 | TEST_COMMENTS_DIR="$HOME/pc_test_comments_dir" 5 | if [ -e $TEST_COMMENTS_DIR ]; then 6 | # echo "deleting $TEST_COMMENTS_DIR from last run" 7 | rm -rf $TEST_COMMENTS_DIR 8 | fi 9 | # mkdir -p $TEST_COMMENTS_DIR 10 | 11 | # if the server is running, kill it 12 | PID=$(pgrep private_comments) 13 | if [ "$PID" != "" ]; then 14 | # echo "Shutting down current private_comments server" 15 | pkill private_comments 16 | fi 17 | 18 | # echo "starting server" 19 | # start it and have it use the disposable directory 20 | PRIVATE_COMMENTS_DIR=$TEST_COMMENTS_DIR ../private_comments & 21 | # PRIVATE_COMMENTS_DIR=$TEST_COMMENTS_DIR ../private_comments 2> /dev/null & 22 | disown 23 | 24 | # echo "pid: "$(pgrep private_comments) 25 | echo "status: "$(curl -s http://localhost:5749/status) 26 | sleep 0.5 27 | # sleep because without it the first test starts outputing and THEN 28 | # we see the output from PC booting 29 | # makes the output ugly 30 | 31 | REPO_ROOT=$(git rev-parse --show-toplevel) 32 | 33 | PROJECT_NAME_HASH="pc_testing_test_project_hash" 34 | FILE_PATH_HASH="41c4765834d1627278775e6b5faa920d98d82dddcae6e4bf66b32de9725b1e00" 35 | TREEISH_ONE="d689d9f4012e2d222cb69bfcb9d0bab2c66f5c7d" 36 | 37 | echo "END SETUP" 38 | } 39 | 40 | teardown_suite () { 41 | # echo "BEGIN TEARDOWN" 42 | # echo "Shutting down server" 43 | pkill private_comments 44 | # echo "END TEARDOWN" 45 | } 46 | 47 | 48 | --------------------------------------------------------------------------------