From c13fffd0814f91c83bf531bf70b4962b7898810e Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 30 Jul 2018 16:54:07 +0200 Subject: [PATCH] Automatically generate docs.json when it's needed --- .gitignore | 3 --- lib/app.rb | 3 +++ public/docs/.gitignore | 2 ++ public/docs/docs.json | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 public/docs/.gitignore delete mode 100644 public/docs/docs.json diff --git a/.gitignore b/.gitignore index 8b222826..ac523dbe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,3 @@ tmp public/assets public/fonts -public/docs/**/* -!public/docs/docs.json -!public/docs/**/index.json diff --git a/lib/app.rb b/lib/app.rb index b5015b3a..217f2c16 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -35,6 +35,9 @@ class App < Sinatra::Application set :csp, false + require 'docs' + Docs.generate_manifest + Dir[docs_path, root.join(assets_prefix, '*/')].each do |path| sprockets.append_path(path) end diff --git a/public/docs/.gitignore b/public/docs/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/public/docs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/public/docs/docs.json b/public/docs/docs.json deleted file mode 100644 index 0637a088..00000000 --- a/public/docs/docs.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file