Code Monkey home page Code Monkey logo

shins's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shins's Issues

Rendering problem with nested attributes

The nested attributes in the following OpenAPI spec renders incorrectly in the HTML.

Command used was api2html -o index.html .\api.yaml

In the TestNOK the attribute bar is renders » bar indicating that it would be nested although it is on the top level. I assume that this is because the "previous" attribute is nested two levels.

In the example TestOK an additional property is added with nesting at level 1. This fixes the rendering of the top level attribute bar.

It should be noted that the JSON examples are rendered correctly and this only affects the description if the schema.

Screenshot:

screenshot

OpenAPI spec:

openapi: 3.0.0

info:
  title: Test
  version: 0.0.0

paths:
  /nok:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestNOK'
      responses:
        '200':
          description: OK
  /ok:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestOK'
      responses:
        '200':
          description: OK          
          
components:
  schemas:
    TestNOK:
      type: object
      properties:
        foo:
          type: object
          properties:
            foofoo:
              type: string
              example: "foofoo"
            foobar:
              type: object
              properties:
                foobarfoo:
                  type: string
                  example: "foobarfoo"
        bar:
          type: string
          example: "Bar"
    TestOK:
      type: object
      properties:
        foo:
          type: object
          properties:
            foofoo:
              type: string
              example: "foofoo"
            foobar:
              type: object
              properties:
                foobarfoo:
                  type: string
                  example: "foobarfoo"
            foozap:
              type: string
              example: "foozap"
        bar:
          type: string
          example: "Bar"

Can you include external snippets (like in this example) ?

Hi,

I want to replicate what is done with spring restdocs, where they generate snippets of documentation based on the tests in the code, and include those snippets in slate documentation. See an example here: https://github.com/spring-projects/spring-restdocs/blob/v1.1.2.RELEASE/samples/rest-notes-slate/slate/source/api-guide.md.erb

Would it be possible to include external snippets like what is done there with <%= ERB.new(File.read) %> using shins?

Make includes resolve relative to the file with the include line

Example:

index.md

Top
!INCLUDE path/index.md

path/index.md

Middle
!INCLUDE to/index.md

path/to/index.md

Bottom

Currently this gives an error:

shins: included file ./to/index.md not found

Because files are always included relative to the first source file:

shins/index.js

Line 158 in 9faac0f

if (options.source) filename = path.resolve(path.dirname(options.source),filename);

Would it be possible to include relative from the file that is including the file?

API example incorrect

The example in the README for using the API is incorrect.
In particular,
var shins = require('shins');

does not include the renderer. I think this is because the file declared as 'main' in the package.json is not index.js, but arapaho.js.

I'm not sure what the actual intention is regarding which module should be main so I'm logging this against the documentation.

Markdown interpreter makes problem with code blocks

C# interfaces are written in the following structure if you work with generics

MethodName(...);

And the part in between < > these signs is interpreted by the markdown interpreter and thus not shown in the code block. See screenshot and see code

Code

class MyEventRegisterer : EventRegisterer
{
    public override void RegisterEvents()
    {
        Register<InputTrigger>();
        Register<ClientConnecting>();
        Register<ClientConnected>();
        Register<ConnectedToNetwork>();
        Register<ConnectionEstablished>();
        Register<ClientDisconnected>();
        Register<RequestClientList>();
        Register<ResponseClientList>();
        Register<SnapShotGenerated>();
        Register<SnapShotDeltaGenerated>();
        Register<GameObjectSpawned>();
        Register<GameObjectDestroyed>();
        Register<GameObjectDisabled>();
        Register<GameObjectEnabled>();
        Register<NewInterpolationSpan>();
        Register<RequestSpawnGameObject>();
        Register<RequestDestroyGameObject>();
        Register<RequestEnableGameObject>();
        Register<RequestDisableGameObject>();
    }
}

And how it is displayed in shins

screenshot_2

No TOC generated for sections in includes

There are no Table of Contents entries generated for any sections in include files. I don't have time to submit a fix myself, but located two issues with the layout.ejs.

  • The include files get rendered after the TOC is rendered.
  • The TOC only uses page_content which does not contain the includes content anyway.

[Question] How to build the website for on premise hosting

It is for sure a stupid question, as everyone will think, how can you not know that. But to be fair, I don't know much about javascript and all the new frameworks and cool stuff. I was able to write my documentation and preview it with the arapaho webserver. Awesome. But how to build the website now into a static resource, so I can pack this documentation with my framework?

I checked the CLI make-shiv, but wasn't able to get it to run, it always throw me a error.

So my question is now how to get a rendered static version of the documentation?

Inline build is missing slate font data

When building with --inline, there is no sideloaded font for slate.ttf, wf, ... These are referenced back to the source folder. So maybe a) upload the font somewhere and sideload it in the html file, b) use a generic font that is present on all systems (looks ugly) or c) use a already well used font like googles robo or whatever and sideload this font.

split the documentation into separate endpoints

Hi, instead of having all the endpoints description into one single page, having the possibility to make a separate sub-page for each of them could help improve performance for very large specifications. Is there currently a way to do something like this with shins or has such a feature been considered?

[Request] Allow override for layout.ejs

This would be handy for more customized output, I was surprised this wasn't possible.

It might also be worth building the body separately from the rest of the HTML so it can fit as-is into a another HTML shell.

Great package, thanks for your work!

TOC deeper nesting not working

Hi,

the ToC deeper nesting seems not to work. The function makeToc does not even contain a section with selectors as described in the Wiki.
How deeper nesting should be achieved?

Thanks

Support (more) complex "includes" structure

All,

First of all, thanks for this project. I was trying to run a custom layout and wanted to organise my pages in a different way and have them organised per "domain"

I thus change my layout and index.html.md to have a locals like

 "toc_footers": ["<a href=\"https://www.murex.com\">Copyright & other legal stuff....</a>"],
        "custom": [{
            "name": "domain_name_1",
            "includes": ["api", "api5", "api3", "api4"]
        }, {
            "name": "domain name 2",
            "includes": ["api2"]
        }, {
            "name": "domain name 3",
            "includes": ["api2"]
        }],
        "search": true,
        "highlight_theme": "dracula",
        "headingLevel": 3
    }

What I observe is that the method function preProcess(content,options) { in index.js is called as many times as the number of "name" in the custom attr.
resulting in the content being in index.html.md being added multiple times.

What am I missing?
Is this something (that could be) supported?
Apologies if I missed something and if this is already supported.

thanks

The option to inline resources (--inline) does not include custom css

If I only specify the --customcss option, relative links to the custom stylesheets (such as pub\css\theme_overrides.css) are included in the generated index.html-file. This is as expected.

However, when using the --inline option together with the --customcss option, the custom styles in theme_overrides.css are not included (I have not checked the other custom stylesheets, but expect the same to be true for them).

I have placed my custom theme_overrides.css-file in the \pub\css-folder under the \node_modules\shins-folder, since that is where I expect shins to be looking for them when I use the --inline option, but that doesn't help. My custom styles are not included.

Is this a bug, or is it intentional?

I do see that some styles are included, but I think these are only the standard styles.

PS:
I also see that the included styles take up a lot of space, as they include comments and whitespace etc. The included CSS should be minified. Several modules exist that can do this.

Changes to nested includes are not picked up

Hi there,

When using nested includes (includes placed in an subfolder within the source/includes folder, as documented on the wiki), changes to them will not be picked up while using the arapaho server locally. As nested includes are a documented feature and will otherwise work, this is clearly an oversight.

It can be solved by changing the watch on the includes folder to be recursive.

Thanks.

The --minify option fails due to missing shins.js

Having installed the latest npm module (2.0.1-3), using the --minify option from the commandline throws an error. I think the error was there before too, but I worked around it then. I am choosing to report it this time.

This is the output from my console:

{ Error: C:\Source\Repos\Testing\node_modules\shins\source\layouts\layout.ejs:31
29| <%- stylesheet_link_tag(current_page.data.highlight_theme||'darkula','screen') %>
30| <% if (current_page.data.search) {%>

31| <%- javascript_include_tag("all") %>
32| <% } else { %>
33| <%- javascript_include_tag("all_nosearch") %>
34| <% } %>

ENOENT: no such file or directory, open 'C:\Source\Repos\Testing\node_modules\shins\pub\js\shins.js'
at Error (native)
at Object.fs.openSync (fs.js:642:18)
at Object.fs.writeFileSync (fs.js:1348:33)
at Object.javascript_include_tag (C:\Source\Repos\Testing\node_modules\shins\index.js:58:16)
at eval (eval at compile (C:\Source\Repos\Testing\node_modules\ejs\lib\ejs.js:549:12), :30:17)
at returnedFn (C:\Source\Repos\Testing\node_modules\ejs\lib\ejs.js:580:17)
at tryHandleCache (C:\Source\Repos\Testing\node_modules\ejs\lib\ejs.js:223:34)
at Object.exports.renderFile (C:\Source\Repos\Testing\node_modules\ejs\lib\ejs.js:437:10)
at C:\Source\Repos\Testing\node_modules\shins\index.js:212:13
at Object.render (C:\Source\Repos\Testing\node_modules\shins\index.js:132:28)
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\Source\Repos\Testing\node_modules\shins\source\layouts\layout.ejs' }

It seems to be expecting shins.js to exist under \pub\js, which it doesn't. Rather, shins.js exists in the root-folder of the repo.

I can work around this issue by adding \pub\js\shins.js to the \shins-folder under \node_modules, so it is not a critical bug, but would be nice if it was fixed.

Zero exit code when include file does not exist

Hi. When shins terminates due to an include markdown file not existing, shins seems to return with a zero exit code. Expected behaviour would be a non-zero exit code to indicate that something has gone wrong.

BUG: page errors on load due to id="" in title

I am using widdershins to generate the markdown for use in shins. When opening the resultant docs in my web browser, I do not see the language tabs, and get an error. Widdershins is generating the following element at the top:

<h1 id="">My API Test</h1>

The lack of a non-empty id attribute is throwing the error, in _lang.js:40

Uncaught Error: Syntax error, unrecognized expression: #
    at Function.Sizzle.error (_jquery.js:1580)
    at Sizzle.tokenize (_jquery.js:2232)
    at Sizzle.select (_jquery.js:2659)
    at Function.Sizzle [as find] (_jquery.js:884)
    at jQuery.fn.init.find (_jquery.js:2922)
    at new jQuery.fn.init (_jquery.js:3032)
    at jQuery (_jquery.js:98)
    at HTMLAnchorElement.<anonymous> (_toc.js:41)
    at Function.each (_jquery.js:362)
    at jQuery.fn.init.each (_jquery.js:157)
Sizzle.error @ _jquery.js:1580
Sizzle.tokenize @ _jquery.js:2232
Sizzle.select @ _jquery.js:2659
Sizzle @ _jquery.js:884
find @ _jquery.js:2922
jQuery.fn.init @ _jquery.js:3032
jQuery @ _jquery.js:98
(anonymous) @ _toc.js:41
each @ _jquery.js:362
each @ _jquery.js:157
recacheHeights @ _toc.js:38
makeToc @ _toc.js:93
loadToc @ _toc.js:115
(anonymous) @ index.html?perl:24
mightThrow @ _jquery.js:3583
process @ _jquery.js:3651
setTimeout (async)
jQuery.readyException @ _jquery.js:3868
(anonymous) @ _jquery.js:3888
mightThrow @ _jquery.js:3583
process @ _jquery.js:3651
setTimeout (async)
(anonymous) @ _jquery.js:3689
fire @ _jquery.js:3317
fireWith @ _jquery.js:3447
fire @ _jquery.js:3455
fire @ _jquery.js:3317
fireWith @ _jquery.js:3447
process @ _jquery.js:3671
setTimeout (async)
(anonymous) @ _jquery.js:3689
fire @ _jquery.js:3317
fireWith @ _jquery.js:3447
fire @ _jquery.js:3455
fire @ _jquery.js:3317
fireWith @ _jquery.js:3447
ready @ _jquery.js:3920
completed @ _jquery.js:3930

It appears _toc.js is trying to parse an invalid ID. When I add an identifer there, all works as expected.

Unable to create "spacers" in TOC with blank h1s like with Slate

Hi @MikeRalphson, could use your help on a nitpicky little issue I'm having.

Using lord/slate, I can include a _blank.md file containing only the code

<h1 id="_"><br> </h1>

wherever I need to create a gap between items in the TOC.

Slate renders this as

<a href="#_" class="toc-h1 toc-link" data-title=" "><br> </a>

in the resulting index.html file.

Using the exact same source files in shins doesn't display the same behavior, it renders as

<a href="#_" class="toc-h1 toc-link" data-title=" "> </a>

without the <br> and I can't figure out how to get shins to keep it!

New --root option not supported when building styles

The new --root option is very handy, in particular when you want to use shins as a standalone builder without the source files directly in the repo. We've created a Docker image that contains the shins source, but mount a separate volume as root which then contains the source and pub directories, which are then the only things in our repo.

But we currently can't use the buildstyles.js script, since it doesn't care about --root at all.

Also to mention, it would really be nice if the --root option changed the output location of index.html automatically rather than have to specify that through --output, since all references to resources in the generated HTML is relative to root.

TradeGecko theme

Hey!

Thanks a lot for porting this over to node, makes it a lot easier for me to utilize it.

In the documentation it mentions that there is an alternate theme provided by TradeGecko, but how would i be able to access this specific theme? As it is not a part of the highlighter module.

The only references i found was for highlight_theme, but there is no tradegecko value available there either.

Is this in any way related to https://developer.tradegecko.com/docs.html and https://github.com/tradegecko/smaug ?

Arbitrary CSS and Logo Paths

Currently the only way to include a custom logo and styling is to directly edit source/images/logo.png and pub/css directly. This means that every time an update is pushed the custom css and logo must be replaced again and again. To fix this it would make sense to add a pair of command line arguments such as --csspath [path/to/folder/] and logopath [path/to/file.png] that allow the user to pass arbitrary paths to their custom css folders and logo file.

How to include files from project dir instead of node_modules

I'm trying to use this project using the api as its own project but I cannot get it to include files from anywhere out side of the node_modules/shins/source/includes directory.

If you project structure looks like:

├── index.js
├── node_modules
├── source
│   ├── includes
│   │   ├── errors.md
│   │   └── travis.md
│   └── index.html.md
└── package.json

My API Code looks like:

const fs = require('fs')
let shins = require('shins');
const path = require("path");

async function genDocs () {
  options = {};
  options.cli = true; // if true, missing files will trigger an exit(1)
  options.minify = false;
  options.customCss = false;
  options.inline = true;
  options.unsafe = false; // setting to true turns off markdown sanitisation
  options['no-links'] = false; // if true, do not automatically convert links in text to anchor tags
  const fileLocation = 'source'
  options.source = path.resolve(`${fileLocation}`) // used to resolve relative paths for included files
  // options.logo = './my-custom-logo.png';
  options['logo-url'] = 'https://www.example.com';
  const files = await fs.readFileSync(path.resolve(`${fileLocation}/index.html.md`), 'utf8')
  const markdownString = files 
  shins.render(markdownString, options, async (err, html) => {
    await fs.writeFileSync('test.html', html)
  });
}

genDocs()

Even though I am specifying the options.source it keeps just looking in
node_modules/shins/source/includes for the included files. Is there any way to get it to look at the project source and not the location of the shins source. I think this is related to #47 which sets the directory to always be __dirname but maybe I am just reading the docs wrong. From what I can tell source should let me configure where the includes folder is but it doesn't seem to do anything.

Am I using source wrong? How is options.source intended to be used?

Thanks!

Serving via arapaho doesn't check for changes in includes

While authoring documentation, it is convenient to serve using the included arapaho.js. However, arapaho doesn't pick up changes to files in the source/includes directory.

The workaround is to modify source/index.html.md or delete index.html, but this is not an ideal workflow.

I see two possible solutions:

  1. Modify the behavior of arapaho.js such that it rebuilds the html on every request in a temp directory, then serves it from there. (Arguably, anything destructive to the index.html at the project's root should be done explicitly anyway.)
  2. If any one of source/index.html.md or files inside source/includes/ has modified since index.html was modified, rebuild index.html.

My preference is the former, but I understand this may be a breaking change if folks are serving docs in production using arapaho.js. Maybe a good compromise would be to specify a switch or argument when invoking arapaho to specify you want to always rebuild and serve the temp index.html.

Thoughts on this?

Can’t set a local custom logo

Hi there,

I’m trying to set a custom logo outside of source. When I pass the parameter to shins via —logo , it gets ignored, and the path in the HTML file stays at /source/images/custom_logo.png.

I’ve tried editing the index.js file (I’m no dev) to no avail. What’s weird is that shins seems to ignore my edits to the JS file, so perhaps I’m missing something here. A cache?

Thanks for helping!

Feature request: Arapaho cli options for logo/customcss

Right now it's feels quite awkward to use the built in server and have custom css and it doesn't look like logo is supported. It would be nice to be able to launch the server as node arapaho --customcss --logo... just like shins so that I can see what my final build might look like?

Incomplete build with --minify

The documentation for the --minify option states that after building the site using it one can deploy a complete version of the site by just uploading the index.html file and pub directory.

That seems to be incorrect. The build still generates references to particularly images within the source directory. These image URLs can't be fixed without patching the layout template. The whole image_tag template helper function is hardwired to the source directory too.

The ideal situation in my opinion is that the build should compile and copy all resources from source to the pub directory, and all URLs should reference files in pub.

I've currently solved this by creating a custom npm command which both copies images from source to pub, and compiles all .scss files from source/stylesheets to pub/css before running the shins build. This also means I can write override styles in .scss files instead of directly editing .css files in pub.

I can also note that I think the fonts are also referenced from source, not from this GitHub repo as the documentation states by default. Though I've removed the use of this font from our site, so can't confirm that this is correct right now.

Unintended behaviour when <'EOF' is included in a code snippet

Issue

I have markdown file with a shell code snippet that has <'EOF' as a string included in it. After rendering the .md everything after the <'EOF' is omitted in that code block. I believe this is unintended behaviour. I have included an example.

I looked into the code and to me it looks like the sanitizeHtml(...) function sanitizes a bit too much.

shins/index.js

Line 217 in ac1d5c8

a[i] = sanitizeHtml(a[i],sanitizeOptions);

Example

Here is an example .md file.
example.html.md.zip

Expected

Screen Shot 2019-05-10 at 12 08 06 PM

Actual

Screen Shot 2019-05-10 at 12 07 47 PM

Generated anchor are not uniq

The generated list of anchors are not uniq meaning you can have conflicts if you have subtitle with the same name.

Example:

# Authentication
## Default

# Authorization
## Default

If you click on the second "Default" link, you will be redirected to the first one.

only php langage tab ever renders

I am using widdershins to generate markdown, and shins.js to generate html. Only the php language tab gets included in my html, but all languages are present in the initial markdown's language tabs section.

layout option does not resolve to absolute path

I'm running shins via a wrapper Node.js app. In my options object, I'm trying to pass an alternate layout file:

const options = {
    cli: false, // if true, missing files will trigger an exit(1)
    minify: false,
    customCss: false,
    inline: false,
    layout: `${__dirname}/_docs/apis/source/layouts/jekyll.ejs`
  };

and then when I invoke

shins.render(source, options, function(err, html) { ... }

I get an err

Error: ENOENT: no such file or directory, open '/Users/david.biesack/dev/node_modules/shins/Users/david.biesack/dev/_docs/apis/source/layouts/jekyll.ejs'

Shins is apparently appending my absolute layout path /Users/david.biesack/dev/_docs/apis/source/layouts/jekyll.ejs
to where the shins npm module is inside my dev project, /Users/david.biesack/dev/node_modules/shins

I cannot store my layout file in node_modules/shins.

I suggest shins only look relative to its deployment root if the layout path is relative (does not start with / or ./). This may require changing how the default path is passed.

Additional Javascript (e.g. clipboard support) buttons etc

I'm hoping this question isn't too elementary but I was wondering how the workflow of shins works. For example, I want to incorporate ClipboardJS into the docs so that users can copy code to their clipboard. If I place the ClipboardJS's JavaScript file in source/javascripts/lib and my own JavaScript file in source/javascripts/app, how can I get my code to run before building the Markdown files into HTML files?

My current process is to add two script tags in all_nosearch.inc, which means my copy buttons are attached after the HTML files are loaded. I want the copy buttons to be part of the HTML files. Hope this makes sense.

Wrong css includes

Hello,

I'm using master and when I'm generating the output with:

node shins.js --customcss --css pub/css/tradegecko.min.css

The css are included like this in the generated html file:

    <link rel="stylesheet" media="screen" href="pub/css/screen.css">
    <link rel="stylesheet" media="screen" href="pub/css/screen_overrides.css">
    <link rel="stylesheet" media="screen" href="pub/css/tradegecko.min.css">
    <link rel="stylesheet" media="print" href="pub/css/print.css">
    <link rel="stylesheet" media="print" href="pub/css/print_overrides.css">
    <link rel="stylesheet" media="print" href="pub/css/tradegecko.min.css">
    <link rel="stylesheet" media="screen" href="pub/css/darkula.css">
    <link rel="stylesheet" media="screen" href="pub/css/theme_overrides.css">
    <link rel="stylesheet" media="screen" href="pub/css/tradegecko.min.css">

In my opinion there are 2 issues here:

  1. theme_overrides.css should be included last one. This way I can override the themes without having to modify inside their files. I guess this is the purpose of this file.
  2. tradegecko.min.css is included twice in the screen context

Thanks,
Silviu

Rationale?

Why port? I'm curious, but also, others would be (potential users, potential contributors)

Using shins in AWS lambda

Hello!

I have case where we have lot's of different API products, all having their own slate-doc file.

Because all those API's / slate-docs have different maintainers, we are currently experimenting in storing those slate-docs to Contentful, and then generating slate-html when requested. (and obviously caching the result for next requests)

I tried to use AWS Lambda and shins for that, but it failed somewhat miserably because shins tries to modify files under node_modules/shins/* , which is read-only filesystem on lambda.

Some options to fix this came to my mind:

  • Could shins be modified so it could create it's files to /tmp instead of node_modules/shins dir ?
  • Could we generate those files during npm install (of our app), and then shins would not try to regenerate files because they exist already ? Or do those files change for every slate-doc ?

I undestand that this may not be very common usecase, but would either of those solutions be acceptable for Shins ? Or perhaps there is a better solution ?

I would of course be willing to create PR for this.

*) It tried to write to atleast /var/task/node_modules/shins/pub/js/shins.js

Javascript fails when markdown input contains titles with {}

Background: I have swagger (2) JSON, which is converted to Slate format using widdershins, and then I try to display it using Shins.

But it seems that if markdown file has headings containing { or }, _toc.js fails with following error in browser, which then renders page somewhat non-usable.

_jquery.js:1463 Uncaught Error: Syntax error, unrecognized expression: #account-exists__get_accounts_{id}_exists
    at Function.Sizzle.error (_jquery.js:1463)
    at Sizzle.tokenize (_jquery.js:2120)
    at Sizzle.select (_jquery.js:2541)
    at Function.Sizzle [as find] (_jquery.js:864)
    at jQuery.fn.init.find (_jquery.js:2787)
    at jQuery.fn.init (_jquery.js:2904)
    at jQuery (_jquery.js:75)
    at HTMLAnchorElement.<anonymous> (_toc.js:40)
    at Function.each (_jquery.js:360)
    at jQuery.fn.init.each (_jquery.js:137)

(Tested with latest Chrome):

Similar error does not happen when using Slate

Source markdown:

    ## Account.exists__get_accounts_{id}_exists

Shins renders it as:

   <a href="#account-exists__get_accounts_{id}_exists" class="toc-h2 toc-link" data-
   title="Account">Account.exists__get_accounts_{id}_exists</a>

Slate renders it as:

  <a href="#account-exists_-em-get_accounts-em-id-_exists" class="toc-h2 toc-link" data-
    title="Account">Account.exists_<em>get_accounts</em>{id}_exists</a>

I did not (yet) further investigate what Sizzle tries to do with that string, but I presume those '{}'-characters can cause other problems too, so perhaps they should be converted to something else ?

Slate seems to just rip them out when rendering html.

Example markdown file:
https://gist.githubusercontent.com/TomiTakussaari/8cbfeab272d53e9d07ca44a4c744e9a8/raw/17ed9c0b5290513ea1863d7c045a973173bd6c27/index.html.md

Config passed to CLI via arguments have to be after input file name

There seems to be a bug where the arguments have to be passed after the input file name as otherwise the shins.js script tries to use the first config argument as the input file name. This works differently to widdershins where the arguments can be passed in before and after the input file name.

Moving some code blocks into centre column

I’m using widdershins and shins together to convert an OpenAPI 3 definition into Slate HTML

I have some markdown in the info.description field of the openapi.yaml file that contains JSON and other code blocks. I’m trying to put these code blocks in the centre column of the Slate HTML page, but leave other code blocks in the right column. I’ve managed to do it using Shins pub/css/screen_overrides.css file but it’s a bit hacky and brittle

Looking at other options I noticed the “att list” syntax extension for Markdown. There’s the https://www.npmjs.com/package/markdown-it-attrs package that implements this. With this extension I could add a class to the code blocks I want to hav in the centre column and then target that class from my CSS overrides

Would it be possible to make shins configurable like widdershins is and to have a config option for specifying a list of markdown extensions to load, eg listed by package name?

Support for favicon or custom head template

I don't want to modify layout.ejs, since that would make it difficult to upgrade the module, but I see no other way of making changes to the <head>-section in the produced HTML.

My foremost need is to add a favicon, so that is my basic request. A default favicon in the images-folder could be used, for example, and then overridden similarly to the way it is done with the logo-image.

However, I can foresee other needs as well (such adding Google Analytics, and various-sized apple-touch-icons), so a more general solution would also be welcome (such as a custom head-template-file that can be inserted dynamically, if it exists, or if it is specified as an option).

Icons are broken

The icon font in shins is not loaded correctly
image

I tried copying the font files into my pub folder but that yielded no results. Any ideas?

Thanks

Feature: load code snippets from Github for sample codes

In language tabs, I would like to load code snippets for each tab from Github rather than hard-coding it in markdown file. In markdown file, I would specify the Github Url for each language. This would help me save duplication content and single file as source of truth.

Is it something currently doable using Shins.

Customising the output path

Hi. I’m using shins as an NPM dependency rather than having a copy of all the files in the shins repo. It’s working really well but one limitation I’ve hit is not being able to override the output path of ./index.html in ./shins.js. Would it be possible to make the output path configurable like it is in widdershins? Thanks

Demos/Live examples?

Hi Mike! I'm considering replacing Slate with Shins, but I would like to see an example or two. Do you have any examples?

Injecting API key dynamically

Once a user is logged into our site, I'd like to be able to inject a user's API key dynamically into the API calls within the documentation. I'm using Widdershins to generate the base docs from OpenAPISpec, and wondering if I would need to add a div/id into the generated Markdown, and then have some custom JS in Shins to accomplish this.

Has anyone achieved a scenario like this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.