1"use strict";(globalThis.webpackChunkdoteki_website=globalThis.webpackChunkdoteki_website||[]).push([[109],{3402(e,n,t){t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>h,frontMatter:()=>d,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"configuration/plugin-configuration","title":"Plugin Configuration","description":"Common configuration","source":"@site/docs/configuration/plugin-configuration.md","sourceDirName":"configuration","slug":"/configuration/plugin-configuration","permalink":"/docs/configuration/plugin-configuration","draft":false,"unlisted":false,"editUrl":"https://github.com/welpo/doteki/tree/main/website/docs/configuration/plugin-configuration.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"General configuration","permalink":"/docs/configuration/general-configuration"},"next":{"title":"Plugins","permalink":"/docs/category/plugins"}}');var s=t(4848),l=t(8453);const d={},r="Plugin Configuration",o={},c=[{value:"Common configuration",id:"common-configuration",level:2},{value:"Presets",id:"presets",level:2},{value:"Bullet list (<code>bullet_list</code>)",id:"bullet-list-bullet_list",level:3},{value:"Numbered list (<code>numbered_list</code>)",id:"numbered-list-numbered_list",level:3},{value:"Comma separated with "and" (<code>comma_and</code>)",id:"comma-separated-with-and-comma_and",level:3},{value:"Space separated (<code>space</code>)",id:"space-separated-space",level:3},{value:"Glue (<code>glue</code>)",id:"glue-glue",level:3},{value:"Example",id:"example",level:2},{value:"Specific configuration",id:"specific-configuration",level:2},{value:"Environment variables",id:"environment-variables",level:2},{value:"GitHub Action",id:"github-action",level:3},{value:"Running locally",id:"running-locally",level:3}];function a(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"plugin-configuration",children:"Plugin Configuration"})}),"\n",(0,s.jsx)(n.h2,{id:"common-configuration",children:"Common configuration"}),"\n",(0,s.jsx)(n.p,{children:"All sections allow the following configuration options:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Option"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Example"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"plugin"})}),(0,s.jsx)(n.td,{children:"The plugin to use for the section."}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'plugin = "current_date"'})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"prepend_text"})}),(0,s.jsx)(n.td,{children:"Text shown before whatever the plugin returns."}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'prepend_text = "Last update: "'})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"append_text"})}),(0,s.jsx)(n.td,{children:"Text shown at the end of the section."}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'append_text = "."'})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"inline"})}),(0,s.jsxs)(n.td,{children:["Whether to render the plugin's output inline or as a block. Default: ",(0,s.jsx)(n.code,{children:"false"})]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"inline = true"})})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"preset"})}),(0,s.jsxs)(n.td,{children:["A predefined set of configuration options. Defaults to ",(0,s.jsx)(n.code,{children:"bullet_list"})," when a plugin returns more than one item. See below for more options."]}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'preset = "bullet_list"'})})]})]})]}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"prepend_text"})," and ",(0,s.jsx)(n.code,{children:"append_text"})," fields, ",(0,s.jsx)(n.code,{children:"\\n"})," will be replaced with a newline character, and ",(0,s.jsx)(n.code,{children:"\\t"})," with a tab character, but only when they're inside double quotes (",(0,s.jsx)(n.code,{children:'"'}),"). Single quotes (",(0,s.jsx)(n.code,{children:"'"}),") will treat them literal characters."]}),"\n",(0,s.jsx)(n.h2,{id:"presets",children:"Presets"}),"\n",(0,s.jsxs)(n.h3,{id:"bullet-list-bullet_list",children:["Bullet list (",(0,s.jsx)(n.code,{children:"bullet_list"}),")"]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.strong,{children:"default"})," preset when plugins return a list. Items are rendered as a bullet point list:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Item 1"}),"\n",(0,s.jsx)(n.li,{children:"Item 2"}),"\n",(0,s.jsx)(n.li,{children:"Item 3"}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"numbered-list-numbered_list",children:["Numbered list (",(0,s.jsx)(n.code,{children:"numbered_list"}),")"]}),"\n",(0,s.jsx)(n.p,{children:"Renders elements as a numbered list:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Item 1"}),"\n",(0,s.jsx)(n.li,{children:"Item 2"}),"\n",(0,s.jsx)(n.li,{children:"Item 3"}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"comma-separated-with-and-comma_and",children:['Comma separated with "and" (',(0,s.jsx)(n.code,{children:"comma_and"}),")"]}),"\n",(0,s.jsx)(n.p,{children:'Each item is rendered as a comma separated list, with "and" before the last item:'}),"\n",(0,s.jsx)(n.p,{children:"Item 1, Item 2, and Item 3"}),"\n",(0,s.jsxs)(n.h3,{id:"space-separated-space",children:["Space separated (",(0,s.jsx)(n.code,{children:"space"}),")"]}),"\n",(0,s.jsx)(n.p,{children:"Elements are joined together with a space
1:"}),"\n",(0,s.jsx)(n.p,{children:"Item 1 Item 2 Item 3"}),"\n",(0,s.jsxs)(n.h3,{id:"glue-glue",children:["Glue (",(0,s.jsx)(n.code,{children:"glue"}),")"]}),"\n",(0,s.jsx)(n.p,{children:"Items are joined together with no separator:"}),"\n",(0,s.jsx)(n.p,{children:"Item 1Item 2Item 3"}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsxs)(n.p,{children:["With a ",(0,s.jsx)(n.code,{children:"README.md"})," like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",children:"\x3c!-- last_updated start --\x3e\x3c!-- last_updated end --\x3e\n"})}),"\n",(0,s.jsxs)(n.p,{children:["And a ",(0,s.jsx)(n.code,{children:"doteki.toml"})," config with the example values from above:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",metastring:'title="doteki.toml"',children:'[sections.last_updated]\nplugin = "current_date"\nprepend_text = "Last updated on "\nappend_text = "."\ninline = true\nformat = "%A, %d %B %Y"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["d\u014dteki would place this between the markers in ",(0,s.jsx)(n.code,{children:"README.md"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",children:"Last updated on Wednesday, 21 October 2015.\n"})}),"\n",(0,s.jsxs)(n.p,{children:["You could get the same final output without ",(0,s.jsx)(n.code,{children:"prepend_text"})," and ",(0,s.jsx)(n.code,{children:"append_text"}),", by having this in your ",(0,s.jsx)(n.code,{children:"README.md"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",children:"Last updated on \x3c!-- last_updated start --\x3e\x3c!-- last_updated end --\x3e.\n"})}),"\n",(0,s.jsxs)(n.p,{children:["If you had ",(0,s.jsx)(n.code,{children:"inline = false"}),", the output would be:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-md",children:"Last updated on \x3c!-- last_updated start --\x3e\nWednesday, 21 October 2015\n\x3c!-- last_updated end --\x3e.\n"})}),"\n",(0,s.jsx)(n.p,{children:"which is probably not what you want."}),"\n",(0,s.jsx)(n.h2,{id:"specific-configuration",children:"Specific configuration"}),"\n",(0,s.jsxs)(n.p,{children:["Each plugin can have its own configuration options. See the plugin's page for more information. ",(0,s.jsx)(n.a,{href:"/docs/category/plugins",children:"Click to see the list of plugins"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"environment-variables",children:"Environment variables"}),"\n",(0,s.jsxs)(n.p,{children:["If a plugin is asking you to set an environment variable, it's because it needs to access sensitive information, such as an API key. If you added this information to ",(0,s.jsx)(n.code,{children:"doteki.toml"}),", it would be visible to anyone who can see your repository."]}),"\n",(0,s.jsx)(n.h3,{id:"github-action",children:"GitHub Action"}),"\n",(0,s.jsxs)(n.p,{children:["If you're using the ",(0,s.jsx)(n.a,{href:"https://github.com/welpo/doteki-action",children:"GitHub Action"}),", you can set secrets in your repository settings."]}),"\n",(0,s.jsx)(n.p,{children:'On your profile repository, go to the "Settings" tab and click on "Secrets and variables", then "Actions".'}),"\n",(0,s.jsx)(n.p,{children:'There you can create a new repository secret, say, "lastfm", and add the value for the variable there:'}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{src:"https://cdn.jsdelivr.net/gh/welpo/doteki-action@main/assets/secret.png",alt:"Creating a secret"})}),"\n",(0,s.jsxs)(n.p,{children:["Finally, in your workflow file, add a line at the end of the ",(0,s.jsx)(n.code,{children:"steps"})," section, inside ",(0,s.jsx)(n.code,{children:"env"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:"env:\n DOTEKI_LASTFM_API_KEY: ${{ secrets.lastfm }}\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Note"}),": The string on the left side is the name of the environment variable that the plugin expects. ",(0,s.jsx)(n.code,{children:"secrets.<name>"})," must match the name of the secret you created."]}),"\n",(0,s.jsx)(n.h3,{id:"running-locally",children:"Running locally"}),"\n",(0,s.jsx)(n.p,{children:"Setting an environment variable in your shell will make it available to d\u014dteki:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'env DOTEKI_LASTFM_API_KEY="your-lastfm-api-key" doteki\n'})})]})}function h(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},8453(e,n,t){t.d(n,{R:()=>d,x:()=>r});var i=t(6540);const s={},l=i.createContext(s);function d(e){const n=i.useContext(l);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.