mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-12 07:50:34 +03:00
Fix markdown newlines to be gfm (fixes #82)
This commit is contained in:
parent
a3c11d184b
commit
eb0beda4e6
53
lib/index.ts
Normal file
53
lib/index.ts
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
'use strict';
|
||||||
|
import './components/Redoc/redoc-initial-styles.css!css';
|
||||||
|
import 'dropkickjs/build/css/dropkick.css!css';
|
||||||
|
import 'prismjs/themes/prism-dark.css!css';
|
||||||
|
import 'hint.css/hint.base.css!css';
|
||||||
|
//import { redocVersion } from './version.js';
|
||||||
|
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { Redoc } from './components/index';
|
||||||
|
import { optionsService } from './redoc.module.ts';
|
||||||
|
|
||||||
|
//Redoc.version = redocVersion;
|
||||||
|
var moduleRef;
|
||||||
|
export var init = function(specUrl:string, options) {
|
||||||
|
if (!optionsService.options.debugMode) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (moduleRef) {
|
||||||
|
destrot();
|
||||||
|
}
|
||||||
|
|
||||||
|
optionsService.options = options;
|
||||||
|
optionsService.options.specUrl = optionsService.options.specUrl || specUrl;
|
||||||
|
|
||||||
|
Redoc.showLoadingAnimation();
|
||||||
|
return SpecManager.instance().load(specUrl)
|
||||||
|
.then(() => {
|
||||||
|
|
||||||
|
return platformBrowserDynamic().bootstrapModule(MyAppModule);
|
||||||
|
})
|
||||||
|
.then(appRef => {
|
||||||
|
Redoc.hideLoadingAnimation();
|
||||||
|
Redoc.appRef = appRef;
|
||||||
|
console.log('ReDoc bootstrapped!');
|
||||||
|
}).catch(err => {
|
||||||
|
Redoc.hideLoadingAnimation();
|
||||||
|
Redoc.displayError(err);
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export var destroy = function() {
|
||||||
|
//t
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export var autoInit = function() {
|
||||||
|
// tes
|
||||||
|
};
|
||||||
|
|
||||||
|
autoInit()
|
28
lib/redoc.module.ts
Normal file
28
lib/redoc.module.ts
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import { NgModule, provide } from '@angular/core';
|
||||||
|
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
|
||||||
|
import { Redoc } from './components/Redoc/redoc';
|
||||||
|
import { OptionsService, RedocEventsService, MenuService,
|
||||||
|
ScrollService, Hash, WarningsService } from './services/index';
|
||||||
|
import { SpecManager } from './utils/SpecManager';
|
||||||
|
|
||||||
|
export const optionsService = new OptionsService(new BrowserDomAdapter());
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [ BrowserModule ],
|
||||||
|
declarations: [ Redoc ],
|
||||||
|
bootstrap: [ Redoc ],
|
||||||
|
providers: [
|
||||||
|
SpecManager,
|
||||||
|
BrowserDomAdapter,
|
||||||
|
RedocEventsService,
|
||||||
|
ScrollService,
|
||||||
|
Hash,
|
||||||
|
MenuService,
|
||||||
|
WarningsService,
|
||||||
|
provide(OptionsService, {useValue: optionsService})
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class RedocModule {
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ declare var Prism: any;
|
||||||
const md = new Remarkable({
|
const md = new Remarkable({
|
||||||
html: true,
|
html: true,
|
||||||
linkify: true,
|
linkify: true,
|
||||||
breaks: false,
|
breaks: true,
|
||||||
typographer: false,
|
typographer: false,
|
||||||
highlight: (str, lang) => {
|
highlight: (str, lang) => {
|
||||||
if (lang === 'json') lang = 'js';
|
if (lang === 'json') lang = 'js';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user