1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

typedoc styling updates, fix some props warnings

This commit is contained in:
Matthias Kretschmann 2019-01-21 16:39:16 +01:00
parent 4834ebe4cb
commit 7913e6a065
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 40 additions and 32 deletions

View File

@ -1,6 +1,5 @@
--- ---
title: API Reference title: Squid-py API Reference
description:
--- ---
ReadTheDocs hosts the [squid-py API Reference Docs](https://squid-py.readthedocs.io/en/latest/). ReadTheDocs hosts the [squid-py API Reference Docs](https://squid-py.readthedocs.io/en/latest/).

View File

@ -26,8 +26,8 @@ const DocMain = ({ title, description, tableOfContents, post, single }) => (
DocMain.propTypes = { DocMain.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired, description: PropTypes.string,
tableOfContents: PropTypes.string, tableOfContents: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
post: PropTypes.object.isRequired, post: PropTypes.object.isRequired,
single: PropTypes.bool single: PropTypes.bool
} }

View File

@ -170,6 +170,8 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
data-private={!isPublic} data-private={!isPublic}
data-deprecated={!!deprecation} data-deprecated={!!deprecation}
> >
<h3 className={styles.propertyName}>{name}</h3>
<div <div
className={styles.propertyType} className={styles.propertyType}
data-type={kindString.toLowerCase()} data-type={kindString.toLowerCase()}
@ -177,8 +179,6 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
{kindString} {kindString}
</div> </div>
<h3 className={styles.propertyName}>{name}</h3>
{isStatic && <div className={styles.propertyModifier}>static</div>} {isStatic && <div className={styles.propertyModifier}>static</div>}
{!isPublic && ( {!isPublic && (
<div className={styles.propertyModifier} data-secondary> <div className={styles.propertyModifier} data-secondary>
@ -197,22 +197,24 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
</a> </a>
)} )}
{!!deprecation && (
<div className={styles.deprecation}>
<strong>Deprecated:</strong> use{' '}
<a href={`#${parentAnchor}/${slugify(deprecatedUse)}`}>
{deprecatedUse}
</a>{' '}
instead
</div>
)}
{comment && ( {comment && (
<div className={styles.propertyDescription}> <div className={styles.propertyDescription}>
{comment.text || comment.shortText} {comment.text || comment.shortText}
</div> </div>
)} )}
{deprecation && (
<div className={styles.deprecation}>
<strong>Deprecated:</strong> use{' '}
<code>
<a href={`#${parentAnchor}/${slugify(deprecatedUse)}`}>
{deprecatedUse}
</a>
</code>{' '}
instead
</div>
)}
{(() => { {(() => {
switch (kindString) { switch (kindString) {
case 'Method': case 'Method':

View File

@ -31,12 +31,14 @@
border-radius: $border-radius; border-radius: $border-radius;
position: relative; position: relative;
&[data-private='true'] { &[data-deprecated='true'] {
background: rgba($brand-black, .06); > *:not(.deprecation) {
opacity: .4;
} }
&[data-deprecated='true'] { .sourceLink {
background: rgba($brand-pink, .06); display: none;
}
} }
} }
@ -48,45 +50,44 @@
margin-bottom: $spacer / 4; margin-bottom: $spacer / 4;
margin-top: 0; margin-top: 0;
display: inline-block; display: inline-block;
padding: $spacer / 8 $spacer / 3; padding: 0 $spacer / 4;
border-radius: $border-radius; border-radius: $border-radius;
vertical-align: middle; vertical-align: middle;
} }
.propertyName { .propertyName {
font-size: $font-size-large; font-size: $font-size-large;
padding: 0;
margin-right: $spacer / 3;
} }
.propertyType, .propertyType,
.propertyModifier { .propertyModifier {
font-size: $font-size-small; font-size: $font-size-small;
line-height: 1.4em; color: $brand-grey;
padding: $spacer / 16 $spacer / 6; margin-right: $spacer / 4;
} }
.propertyType { .propertyType {
&[data-type='method'] { &[data-type='method'] {
background: rgba($green, .4); background: rgba($green, .3);
} }
&[data-type='property'] { &[data-type='property'] {
background: rgba($brand-pink, .4); background: rgba($yellow, .3);
} }
} }
.propertyModifier { .propertyModifier {
background: rgba($red, .2); background: rgba($red, .2);
padding: 0 $spacer / 6;
margin-right: $spacer / 3;
&[data-secondary] { &[data-secondary] {
background: rgba($brand-blue, .5); background: rgba($brand-blue, .2);
color: $brand-white;
} }
} }
.propertyDescription { .propertyDescription {
padding: $spacer / 6 0 $spacer / 3; margin-bottom: $spacer;
} }
.sourceLink { .sourceLink {
@ -101,7 +102,13 @@
.deprecation { .deprecation {
font-size: $font-size-small; font-size: $font-size-small;
color: mix($brand-black, $brand-pink, 50%); padding: $spacer / 3;
border: 1px solid $red;
border-radius: $border-radius;
strong {
color: $red;
}
} }
.type { .type {