Skip to content

Commit

Permalink
Improve path, remove navs
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocopat committed Sep 21, 2020
1 parent e9c2f1d commit b71f308
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
5 changes: 4 additions & 1 deletion base-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ markdown_extensions:
- pymdownx.superfences
plugins:
- search
- awesome-pages
- awesome-pages
nav:
- 'Intro': index.md
- 7.31: 7.31/abapdata_options.md
4 changes: 4 additions & 0 deletions docs/css/abap-docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ ul.circlem2 {
/* hide footer */
.md-footer-nav {
visibility: hidden;
}

.md-sidebar {
visibility: hidden;
}
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const parseFiles = function parseFiles(version: string) {
files.forEach((file: SapDocFile) => {
if (DEBUG) {
if (file.name !== 'abapread_table_key'
&& file.name !== 'abapmethods_general'
&& file.name !== 'abapappend'
&& file.name !== 'abapdata_options'
&& file.name !== 'abapread_table'
&& file.name !== 'abapmethods_general'
&& file.name !== 'abapappend'
&& file.name !== 'abapdata_options'
&& file.name !== 'abapread_table'
) {
return;
}
Expand Down
17 changes: 9 additions & 8 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export default class Parser {
}

parse(): string {
const path: CheerioElement = this.$('.path')[0];
if (path) {
this.parsePath(path);
}

const root: CheerioElement = this.$('.all')[0];

if (root === undefined) {
Expand Down Expand Up @@ -102,21 +107,17 @@ export default class Parser {

if (header.isMainTitle) {
this.parseVersioning();
const path: CheerioElement = this.$('.path')[0];
if (path) {
this.parsePath(path);
}
}
}

parseVersioning() {
// Example:
// Versions: <u>7.31</u> [7.40](../cds) [7.54](../cds)

const version731 = this.renderVersion('7.31', this.findFile('7.31'), `../${this.file.name}`);
const version740 = this.renderVersion('7.40', this.findFile('7.40'), `../${this.file.name}`);
const version754 = this.renderVersion('7.54', this.findFile('7.54'), `../${this.file.name}`);
const versioning = `${version731} ${version740} ${version754}\n`;
const version731 = this.renderVersion('7.31', this.findFile('7.31'), `../../7.31/${this.file.name}`);
const version740 = this.renderVersion('7.40', this.findFile('7.40'), `../../7.40/${this.file.name}`);
const version754 = this.renderVersion('7.54', this.findFile('7.54'), `../../7.54/${this.file.name}`);
const versioning = `Other versions: \n ${version731} | ${version740} | ${version754}\n`;
this.renderer.renderText(versioning);
}

Expand Down

0 comments on commit b71f308

Please sign in to comment.