#205 [api] update API docs

This commit is contained in:
Avris 2021-05-21 18:39:14 +02:00
parent b1088a19c5
commit 7330dd504b
16 changed files with 65 additions and 103 deletions

View File

@ -78,6 +78,7 @@ section {
code {
@include font-size($code-font-size);
color: $code-color;
background-color: lighten($code-color, 45%);
word-wrap: break-word;
// Streamline the style when inside anchors to avoid broken underline and more
@ -85,7 +86,7 @@ code {
color: inherit;
}
border: 1px solid $code-color;
border: 1px solid lighten($code-color, 30%);
padding: .2em;
border-radius: $border-radius-sm;
}

View File

@ -48,10 +48,14 @@
</nuxt-link>
</li>
<li class="list-inline-item">
<nuxt-link to="/api">
<nuxt-link v-if="config.api !== null" to="/api">
<Icon v="laptop-code"/>
<T>api.header</T>
</nuxt-link>
<LocaleLink v-else locale="en" link="/api">
<Icon v="laptop-code"/>
<T>api.header</T>
</LocaleLink>
</li>
</ul>
<ul v-if="config.user.enabled" class="list-inline small">

View File

@ -234,16 +234,4 @@ census:
redirects: []
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/she/her'
- '/api/pronouns/she/her?examples[]=Did%20you%20ask%20%7Bpronoun_object%7D%20to%20join%20us%3F'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0XGVJ3T07MV9F6XQ83']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/person']
api: ~

View File

@ -251,9 +251,18 @@ api:
pronouns_one:
- '/api/pronouns/she/her'
- '/api/pronouns/she/her?examples[]=Did%20you%20ask%20%7Bpronoun_object%7D%20to%20join%20us%3F'
pronouns_banner: ['/api/banner/they.png']
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0XGVJ3T07MV9F6XQ83']
sources_one: ['/api/sources/01ERQRCV0V4QVMNKCENF724A08']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/person']
inclusive_all: ['/api/inclusive']
inclusive_search: ['/api/inclusive/search/retard']
terms_all: ['/api/terms']
terms_search: ['/api/terms/search/agender']
profile_get: ['/api/profile/get/andrea']

View File

@ -466,6 +466,7 @@ profile:
links: 'Links'
column: 'Column'
header: 'Cards'
list: 'Your cards'
init: 'Create a card'
show: 'Show'

View File

@ -139,15 +139,4 @@ census:
redirects: []
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/ella'
- '/api/pronouns/ella?examples[]=Creo%20que%20%7Bpronoun%7D%20es%20muy%20querid%7Binflection%7D.'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ET491ME8DPKNN1SV3NBK6KEA']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/esposa']
api: ~

View File

@ -237,15 +237,4 @@ census:
redirects:
- { from: '^/blog/neutral-language-council$', to: '/team' }
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/she/her'
- '/api/pronouns/she/her?examples[]=Did%20you%20ask%20%7Bpronoun_object%7D%20to%20join%20us%3F'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0XGVJ3T07MV9F6XQ83']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/person']
api: ~

View File

@ -143,15 +143,4 @@ census:
redirects: []
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/zij/haar'
- '/api/pronouns/zij/haar?examples[]=Ik%20denk%20dat%20%7Bnominative%7D%20erg%20mooi%20is%3F'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01EX6GDCW730EB5N5HGRMGZ5EK']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/meisje']
api: ~

View File

@ -999,9 +999,18 @@ api:
pronouns_one:
- '/api/pronouns/ono/jej'
- '/api/pronouns/ono/jej?examples[]=Czy%20chcia%C5%82%7Bverb_end_inter%7Dby%C5%9B%20skorzysta%C4%87%20z%20naszej%20oferty%3F%7CCzy%20chci%7Bverb_middle_inter%7Dby%C5%9Bcie%20skorzysta%C4%87%20z%20naszej%20oferty%3F%7C0'
pronouns_banner: ['/api/banner/onu.png']
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0EHWZ4SX05BRFCEFBZ']
sources_one: ['/api/sources/01F1JDD446TNY56PQG7E6MFRRH']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/ateis']
inclusive_all: ['/api/inclusive']
inclusive_search: ['/api/inclusive/search/cygan']
terms_all: ['/api/terms']
terms_search: ['/api/terms/search/apłciow']
profile_get: ['/api/profile/get/andrea']

View File

@ -951,6 +951,7 @@ profile:
links: 'Linki'
column: 'Kolumna'
header: 'Wizytówki'
list: 'Twoje wizytówki'
init: 'Stwórz wizytówkę'
show: 'Pokaż'

View File

@ -125,15 +125,4 @@ census:
redirects: []
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/ela'
- '/api/pronouns/ela?examples[]=Creo%20que%20%7Bpronoun%7D%20é%20muit%20querid%7Binflection%7D.'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ET491ME8DPKNN1SV3NBK6KEA']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/esposa']
api: ~

View File

@ -685,15 +685,4 @@ redirects:
- { from: '^/blog/rada-j%C4%99zyka-neutralnego$', to: '/kolektyw-rjn' }
- { from: '^/blog/rada-języka-neutralnego$', to: '/kolektyw-rjn' }
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/ono/jej'
- '/api/pronouns/ono/jej?examples[]=Czy%20chcia%C5%82%7Bverb_end_inter%7Dby%C5%9B%20skorzysta%C4%87%20z%20naszej%20oferty%3F%7CCzy%20chci%7Bverb_middle_inter%7Dby%C5%9Bcie%20skorzysta%C4%87%20z%20naszej%20oferty%3F%7C0'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0EHWZ4SX05BRFCEFBZ']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/ateis']
api: ~

View File

@ -232,15 +232,4 @@ census:
redirects:
- { from: '^/blog/neutral-language-council$', to: '/team' }
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/she/her'
- '/api/pronouns/she/her?examples[]=Did%20you%20ask%20%7Bpronoun_object%7D%20to%20join%20us%3F'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0XGVJ3T07MV9F6XQ83']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/person']
api: ~

View File

@ -143,15 +143,4 @@ census:
redirects: []
api:
examples:
pronouns_all: ['/api/pronouns']
pronouns_one:
- '/api/pronouns/she/her'
- '/api/pronouns/she/her?examples[]=Did%20you%20ask%20%7Bpronoun_object%7D%20to%20join%20us%3F'
sources_all: ['/api/sources']
sources_one: ['/api/sources/01ERQRCV0XGVJ3T07MV9F6XQ83']
nouns_all: ['/api/nouns']
nouns_search: ['/api/nouns/search/person']
api: ~

View File

@ -239,7 +239,9 @@ export default {
}
}
routes.push({ path: '/api', component: resolve(__dirname, 'routes/api.vue') });
if (config.api !== null) {
routes.push({ path: '/api', component: resolve(__dirname, 'routes/api.vue') });
}
routes.push({ name: 'all', path: '*', component: resolve(__dirname, 'routes/pronoun.vue') });
},

View File

@ -49,6 +49,7 @@
pronouns_one: ['GET', '/api/pronouns/{pronoun}', {
'examples[]': 'Overwrite the default example sentences with custom ones. For each of them use the following format: <code>{sentenceSingular}|{sentencePlural}|{isHonorific}</code>. If <code>sentencePlural</code> is missing, if defaults to being the same as <code>sentenceSingular</code>. <code>isHonorific</code> can be <code>0</code> (default) or <code>1</code>.',
}],
pronouns_banner: ['GET', '/api/banner/{pronoun}.png'],
},
}, {
enabled: this.config.sources.enabled,
@ -66,8 +67,31 @@
nouns_all: ['GET', '/api/nouns'],
nouns_search: ['GET', '/api/nouns/search/{term}'],
},
}, {
enabled: this.config.nouns.inclusive.enabled,
header: 'nouns.inclusive.header',
icon: 'book-heart',
endpoints: {
inclusive_all: ['GET', '/api/inclusive'],
inclusive_search: ['GET', '/api/inclusive/search/{term}'],
},
}, {
enabled: this.config.nouns.terms.enabled,
header: 'nouns.terms.header',
icon: 'flag',
endpoints: {
terms_all: ['GET', '/api/terms'],
terms_search: ['GET', '/api/terms/search/{term}'],
},
}, {
enabled: this.config.profile.enabled,
header: 'profile.header',
icon: 'id-card',
endpoints: {
profile_get: ['GET', '/api/profile/get/{username}'],
},
}],
};
}
},
head() {
return head({