Skip to content

Commit

Permalink
Merge pull request #64 from koraa/karo/inline-markdown-header-styles
Browse files Browse the repository at this point in the history
Styles for headers inside user markdown
  • Loading branch information
ar2rsawseen authored Jan 26, 2020
2 parents a4b9d76 + 11aebd8 commit b049fba
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 11 deletions.
Binary file added static/fonts/SourceCodePro-Light.ttf
Binary file not shown.
Binary file added static/fonts/SourceCodePro-Regular.ttf
Binary file not shown.
63 changes: 62 additions & 1 deletion static/styles/jsdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,51 @@ h6 {
font-style: italic;
}

.usertext h1 {
font-family: "Source Code Pro", monospace;
font-size: 24px;
margin: 2.5em 0 1em;
font-weight: 300;
}

.usertext h2 {
font-family: "Source Code Pro", monospace;
font-size: 18px;
margin: 2em 0 0.5em;
font-weight: 300;

}

.usertext h3 {
font-family: "Source Code Pro", monospace;
font-size: 15px;
margin: 1.5em 0 0;
font-weight: 300;
}

.usertext h4 {
font-family: "Source Code Pro", monospace;
font-size: 14px;
margin: 0 0 0;
font-weight: 400;
}

.usertext h5 {
font-size: 12px;
margin: 1em 0 0;
font-weight: normal;
color: #666;
}

.usertext h6 {
font-size: 11px;
margin: 1em 0 0;
font-weight: normal;
font-style: normal;
color: #666;
}


tt, code, kbd, samp {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
background: #f4f4f4;
Expand Down Expand Up @@ -692,4 +737,20 @@ html[data-search-mode] .level-hide {
url('../fonts/Montserrat-Bold.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/Montserrat-Bold.woff') format('woff'), /* Pretty Modern Browsers */
url('../fonts/Montserrat-Bold.ttf') format('truetype'); /* Safari, Android, iOS */
}
}

@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 300;
font-display: swap;
src: local('Source Code Pro Light'), local('SourceCodePro-Light'), url(fonts/SourceCodePro-Light.ttf) format('truetype');
}

@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/SourceCodePro-Regular.ttf) format('truetype');
}
6 changes: 3 additions & 3 deletions tmpl/container.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<sup class="variation"><?js= doc.variation ?></sup>
<?js } ?></h2>
<?js if (doc.classdesc) { ?>
<div class="class-description"><?js= doc.classdesc ?></div>
<div class="class-description usertext"><?js= doc.classdesc ?></div>
<?js } ?>
<?js } else if (doc.kind === 'module' && doc.modules) { ?>
<?js doc.modules.forEach(function(module) { ?>
Expand All @@ -45,7 +45,7 @@
<div class="container-overview">
<?js if (doc.kind === 'module' && doc.modules) { ?>
<?js if (doc.description) { ?>
<div class="description"><?js= doc.description ?></div>
<div class="description usertext"><?js= doc.description ?></div>
<?js } ?>

<?js doc.modules.forEach(function(module) { ?>
Expand All @@ -57,7 +57,7 @@
<?js= self.partial('details.tmpl', doc) ?>

<?js if (doc.description) { ?>
<div class="description"><?js= doc.description ?></div>
<div class="description usertext"><?js= doc.description ?></div>
<?js } ?>

<?js if (doc.examples && doc.examples.length) { ?>
Expand Down
4 changes: 2 additions & 2 deletions tmpl/exceptions.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?js if (data.description && data.type && data.type.names) { ?>
<dl>
<dt>
<div class="param-desc">
<div class="param-desc usertext">
<?js= data.description ?>
</div>
</dt>
Expand All @@ -22,7 +22,7 @@
<dd></dd>
</dl>
<?js } else { ?>
<div class="param-desc">
<div class="param-desc usertext">
<?js if (data.description) { ?>
<?js= data.description ?>
<?js } else if (data.type && data.type.names) { ?>
Expand Down
2 changes: 1 addition & 1 deletion tmpl/mainpage.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var self = this;
</section>
<?js } ?>
<?js if (data.readme) { ?>
<section class="readme">
<section class="readme usertext">
<article><?js= data.readme ?></article>
</section>
<?js } ?>
2 changes: 1 addition & 1 deletion tmpl/members.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var self = this;
<?js= this.partial('details.tmpl', data) ?>

<?js if (data.description) { ?>
<div class="description">
<div class="description usertext">
<?js= data.description ?>
</div>
<?js } ?>
Expand Down
4 changes: 2 additions & 2 deletions tmpl/method.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ var self = this;
?><?js= (data.signature || '') ?></h4>

<?js if (data.summary) { ?>
<p class="summary"><?js= summary ?></p>
<p class="summary usertext"><?js= summary ?></p>
<?js } ?>
<?js } ?>

<?js= this.partial('details.tmpl', data) ?>

<?js if (data.kind !== 'module' && data.description) { ?>
<div class="description">
<div class="description usertext">
<?js= data.description ?>
</div>
<?js } ?>
Expand Down
1 change: 0 additions & 1 deletion tmpl/properties.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?js
var data = obj;
var props = data.subprops || data.properties;

/* sort subprops under their parent props (like opts.classname) */
var parentProp = null;
props.forEach(function(prop, i) {
Expand Down

0 comments on commit b049fba

Please sign in to comment.