bitovi / documentcss

A documentation/guide portal for the Live Style Guide feature of DocumentJS
https://documentcss.com/
MIT License
72 stars 7 forks source link

What consumes docObject? #48

Open leoj3n opened 7 years ago

leoj3n commented 7 years ago

@tomgreever

Is there any way we can remove your name from being hard-coded in the git repo?

https://github.com/bitovi/documentcss/search?utf8=%E2%9C%93&q=tomgreever

leoj3n commented 7 years ago

As a contributor, if I wanted to build the website locally to see a change I made to one of the DocumentCSS website files, I would do:

~/documentcss master
❯ grunt
Running "generate:forceBuild" (generate) task

Running "build:forceBuild" (build) task

Running "documentjs" task
Generating pages at
Generating examples/styles at examples/styles
Generating examples/demos at examples/demos
Generating guides at docs

Running "connect:server" (connect) task
Started connect web server on http://localhost:4000

Running "watch" task
Waiting...
^C

But then my change would be lost in a sea of modified files, and I would have to go pick out that change by hand (probably using git add --patch) in order to send a PR:

~/documentcss master*
❯ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   docs/customize.html
    modified:   docs/howTo.html
    modified:   docs/index.html
    modified:   docs/publish.html
    modified:   docs/quickstart.html
    modified:   docs/setup.html
    modified:   docs/static/bundles/static.js
    modified:   docs/use.html
    modified:   examples/demos/static/bundles/static.js
    modified:   examples/styles/Styles.baseline-elements.html
    modified:   examples/styles/Styles.docs.html
    modified:   examples/styles/Styles.theme.html
    modified:   examples/styles/_header.less.html
    modified:   examples/styles/api.less.html
    modified:   examples/styles/base.less.html
    modified:   examples/styles/brand.less.html
    modified:   examples/styles/buttons.less.html
    modified:   examples/styles/cascading-list.html
    modified:   examples/styles/code.less.html
    modified:   examples/styles/color-palette.html
    modified:   examples/styles/docs-title.html
    modified:   examples/styles/docs-warning.html
    modified:   examples/styles/forms.html
    modified:   examples/styles/header-bitovi-menu.html
    modified:   examples/styles/header-dropdown.html
    modified:   examples/styles/header-nav.html
    modified:   examples/styles/index.html
    modified:   examples/styles/layout.less.html
    modified:   examples/styles/parameters-returns.html
    modified:   examples/styles/sidebar-list.html
    modified:   examples/styles/sidebar-versions.html
    modified:   examples/styles/sidebar.less.html
    modified:   examples/styles/signature.html
    modified:   examples/styles/simple-tag.html
    modified:   examples/styles/small-signature.html
    modified:   examples/styles/static/bundles/static.js
    modified:   examples/styles/table.html
    modified:   examples/styles/variables.less.html
    modified:   faq.html
    modified:   index.html
    modified:   static/bundles/static.js

I can't just add the file I changed either because it includes paths specific to my computer:

diff --git a/index.html b/index.html
index 2e29ece..f4c33ed 100644
--- a/index.html
+++ b/index.html
@@ -234,7 +234,7 @@

    <script type="text/javascript">
-       var docObject = {"type":"page","name":"home","src":"pages/index.md","description":"","title":"DocumentCSS","hideSidebar":true,"hideTitle":true,"hideContainer":true,"hideArticle":true,"comment":" ","dest":"/Users/tomgreever/server/documentcss/","glob":{"pattern":"pages/*.md","ignore":"{pages/guides.md,pages/guides/**/*,pages/styles.md}","cwd":"/Users/tomgreever/server/documentcss"},"templates":"/Users/tomgreever/server/documentcss/theme/donejs/templates","static":"/Users/tomgreever/server/documentcss/theme/donejs/static","forceBuild":true,"generators":["html"],"docConfigDest":"documentjs.json","project":{}};
+       var docObject = {"type":"page","name":"home","src":"pages/index.md","description":"","title":"DocumentCSS","hideSidebar":true,"hideTitle":true,"hideContainer":true,"hideArticle":true,"comment":" ","dest":"/Users/leoj/src/bitovi/1doc/diff/documentcss/","glob":{"pattern":"pages/*.md","ignore":"{pages/guides.md,pages/guides/**/*,pages/styles.md}","cwd":"/Users/leoj/src/bitovi/1doc/diff/documentcss"},"templates":"/Users/leoj/src/bitovi/1doc/diff/documentcss/theme/donejs/templates","static":"/Users/leoj/src/bitovi/1doc/diff/documentcss/theme/donejs/static","forceBuild":true,"generators":["html"],"docConfigDest":"documentjs.json","project":{}};
    </script>

So, this could be a barrier to entry to those that want to help fixup the DocumentCSS website.

It looks like DocumentJS generates and uses docObject, but I wasn't able to quickly tell if there was a way to make those file path properties relative.

leoj3n commented 7 years ago

This problem is mostly resolved by #51, but the file path properties in the generated files do still have absolute values. Perhaps not such a big issue anymore if #51 is merged.