Drassil / git-wiki-theme

A revolutionary full-featured wiki for github pages and jekyll. You don't need to compile it!
http://drassil.github.io/git-wiki/
MIT License
212 stars 292 forks source link

How about adding style guide? #72

Closed nekketsuuu closed 3 years ago

nekketsuuu commented 4 years ago

Is your feature request related to a problem? Please describe.

Currently, some coding style of Liquid and YAML are not unified. This is a bit confusing when writing codes for pull requests.

Example 1: Should we add spaces or not?

<a target="_blank" href="{{ site.github.repository_url }}/wiki/{{url | remove: '.html' | append: ''}}/_edit">Edit</a>

Example 2: Should we add a space before colon?

use_prose_io: true
service: github
search_engine : "js"
google_cse_token: 007197903287787072094:8rbvkeqo6qw
wiki_folder : "wiki"
permalink: /blog/posts/:year/:month/:day/:title:output_ext

Describe the solution you'd like

How about refactoring the current code and writing a style guide? One example I googled is this.

Yehonal commented 4 years ago

Maybe we could use https://editorconfig.org/ or other formatting solutions with linter support.

nekketsuuu commented 4 years ago

Yeah .editorconfig sounds good. My only one concern is: is it OK for you to add a file which is need to be deleted during installation of git-wiki-theme?

nekketsuuu commented 4 years ago

I noticed .editorconfig can only restrict indent width and cannot restrict spaces in Liquid or spaces around a colon.

Yehonal commented 4 years ago

Yeah .editorconfig sounds good. My only one concern is: is it OK for you to add a file which is need to be deleted during installation of git-wiki-theme?

the preferred/official installation will be the remote_theme one. I've started to change the documentation with 2 methods of installation. so, the git-wiki-skeleton repository should be used as a base for your wiki and if you need special customizations or other kind of changes that cannot be done with remote_theme, you can install git-wiki-theme repository. However, I suggest to not delete any file in any case since the "forking" method is always better for sharing changes