GithubHelp home page GithubHelp logo

cheatset's People

Contributors

cowlibob avatar dafalcon avatar jonasbn avatar kapeli avatar lorin avatar lvauthrin avatar michaeldimmitt avatar suredream avatar yorkxin avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cheatset's Issues

Ability to escape markdown in entry name

I'm writing a cheat sheet for Brett Terpstra's Keybindings Madness. Of course, being Brett Terpstra-related, it has keybindings for Markdown. He has a couple commands that show examples of the generated markdown to show subtle differences between them. Unfortunately, these end up getting rendered instead of displayed. I've tried enclosing the markdown in a <pre> element, but that didn't help. Do you have any thoughts?

Add 'note' tag to category level

It would make a lot of sense to have a note tag on the category level to add some context information. Especially useful when collecting multiple plug-ins in one cheat sheet to give a brief summary of the plug-in.

Shortcut support like StackOverflow

As suggested at Kapeli/cheatsheets#7 (comment) by @jk, I've tried to add support for StackOverflow-style keyboard shortcuts.

This was added in commit d33067a but was removed soon after, because I didn't like the result.

This is what it looks like:

screen shot 2014-03-05 at 19 58 17

If anyone thinks this should be pursued further, please let me know.

What I don't like about it:

  1. It's not so easy to read and causes confusion as there are a lot of separate elements (one for each key)
  2. Users can't search for a command within the page using CMD+F, because it's not easy to type symbols like โŒ˜

Custom styling override?

It would be cool if we could override the styling of cheat sheets, maybe with an option in Preferences to choose a custom path to a css file.

Make compatible with ruby v3+

The resolution of this issue allowed for a clean install/generation of cheatsets for ruby v2+. However, attempting to install the gem in ruby 3.2.2 resulted in some native extension build errors for nokogiri/nokogumbo and sqlite3 (and yes, I installed xcode CL tools). I haven't had time to mess with different versions yet, but most posts I find online that have similar build failures almost always include updating libraries in order to eliminate the errors.

$ gem install cheatset
Fetching sanitize-5.2.3.gem
Fetching sqlite3-1.3.13.gem
Fetching unindent-1.0.gem
Fetching haml-5.2.2.gem
Fetching nokogumbo-2.0.5.gem
Fetching redcarpet-3.6.0.gem
Fetching plist-3.7.0.gem
Fetching rouge-3.30.0.gem
Fetching cheatset-1.4.8.gem
Successfully installed unindent-1.0
Building native extensions. This could take a while...
ERROR:  Error installing cheatset:
	ERROR: Failed to build gem native extension.

    current directory: /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sqlite3-1.3.13/ext/sqlite3
/Users/user/.rbenv/versions/3.2.2/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile

current directory: /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sqlite3-1.3.13/ext/sqlite3
make DESTDIR\= sitearchdir\=./.gem.20231120-29588-5dciji sitelibdir\=./.gem.20231120-29588-5dciji clean

current directory: /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sqlite3-1.3.13/ext/sqlite3
make DESTDIR\= sitearchdir\=./.gem.20231120-29588-5dciji sitelibdir\=./.gem.20231120-29588-5dciji
compiling backup.c
compiling database.c
database.c:60:3: error: call to undeclared function 'rb_check_safe_obj'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  rb_check_safe_obj(file);
  ^
database.c:60:3: note: did you mean 'rb_check_safe_str'?
/Users/user/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/core/rstring.h:383:6: note: 'rb_check_safe_str' declared here
void rb_check_safe_str(VALUE);
     ^
database.c:201:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  return INT2NUM((long)sqlite3_total_changes(ctx->db));
         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:233:3: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
  sqlite3_trace(ctx->db, NIL_P(block) ? NULL : tracefunc, (void *)self);
  ^~~~~~~~~~~~~
  sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3222:36: note: 'sqlite3_trace' has been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
                                   ^
database.c:242:67: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
                                                          ~~~~~~~ ^~~~~~~~~~~
database.c:310:14: error: call to undeclared function 'rb_tainted_str_new2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      return rb_tainted_str_new2((const char *)sqlite3_value_text(val));
             ^
database.c:320:14: error: call to undeclared function 'rb_tainted_str_new'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      return rb_tainted_str_new((const char *)sqlite3_value_blob(val), len);
             ^
database.c:552:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  return INT2NUM((long)sqlite3_errcode(ctx->db));
         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings and 3 errors generated.
make: *** [database.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sqlite3-1.3.13 for inspection.
Results logged to /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/arm64-darwin-22/3.2.0/sqlite3-1.3.13/gem_make.out

docset can not break line

It seems that there is a style error in the generated docset.

The .rb file:

  category do
    id 'Functor'
    entry do
      notes <<-'END'
        ```swift
        1
        2
        3
        ```
      END
    end
  end

generated docset:

1 2 3 

2016-06-28 at 19 10

OSX / Installation fails...

No clude how to proceed... libiconv is installed via macports.

________________________________________________________________________________
| /Users/Shared/develop/Dash/cheatsheets @ imac-pro-559 (robby)
| => sudo gem install cheatset --no-ri --no-rdoc
Building native extensions. This could take a while...
ERROR:  Error installing cheatset:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/nokogumbo-1.5.0/ext/nokogumboc
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180401-7625-x38swz.rb extconf.rb
checking for xmlNewDoc() in -lxml2... yes
checking for nokogiri.h in /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/gems/2.3.0/gems/nokogiri-1.5.6/ext/nokogiri... no
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
checking for iconv_open() in -liconv... no
checking for libiconv_open() in iconv.h... no
checking for libiconv_open() in -liconv... no
checking for libiconv_open() in -liconv... no
-----
libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
	--with-xml2lib
	--without-xml2lib
	--with-libxml-2.0-config
	--without-libxml-2.0-config
	--with-pkg-config
	--without-pkg-config
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--with-iconv-dir
	--without-iconv-dir
	--with-iconv-include
	--without-iconv-include=${iconv-dir}/include
	--with-iconv-lib
	--without-iconv-lib=${iconv-dir}/lib
	--with-xml2-dir
	--without-xml2-dir
	--with-xml2-include
	--without-xml2-include=${xml2-dir}/include
	--with-xml2-lib
	--without-xml2-lib=${xml2-dir}/lib
	--with-xslt-dir
	--without-xslt-dir
	--with-xslt-include
	--without-xslt-include=${xslt-dir}/include
	--with-xslt-lib
	--without-xslt-lib=${xslt-dir}/lib
	--with-libxslt-config
	--without-libxslt-config
	--with-libxml-2.0-config
	--without-libxml-2.0-config
	--with-libiconv-config
	--without-libiconv-config
	--with-iconvlib
	--without-iconvlib
	--with-iconvlib
	--without-iconvlib
	--with-iconvlib
	--without-iconvlib
	--with-iconvlib
	--without-iconvlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/nokogumbo-1.5.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/nokogumbo-1.5.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/nokogumbo-1.5.0/gem_make.out

Feature Request: Multi-entries in the same row

I would like to create a cheatsheet of LaTeX math symbols. Something looks like this. As you can see, there will be lots of short entries to compose such cheatsheet. So instead of having every entries stand in a separate row, is there an easy way to make them occupy multi columns. Thanks.

Install halts on parsing

When I try to install the gem, the process stops on the parsing stage:

sudo gem install cheatset
Password: 
Successfully installed cheatset-1.3.4
Parsing documentation for cheatset-1.3.4

I've left this for a good few hours with no further output.

zshell & bash on a MBP running latest Sierra 10.12.4

NoMethodError when trying to generate a cheatset

It said I successfully installed cheatset , and when I try to generate the sample docset you guys gave, it throws this exception.

% cheatset generate sample.rb
/Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge/lexers/apache.rb:15:in `<class:Apache>': private method `load' called for Psych:Module (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge/lexers/apache.rb:5:in `<module:Lexers>'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge/lexers/apache.rb:4:in `<module:Rouge>'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge/lexers/apache.rb:3:in `<top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge.rb:43:in `load'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge.rb:43:in `block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge.rb:43:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/rouge-1.7.7/lib/rouge.rb:43:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cheatset-1.2.19/lib/cheatset/dsl/base.rb:2:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cheatset-1.2.19/lib/cheatset.rb:5:in `block in <top (required)>'
    from /Library/Ruby/Gems/2.0.0/gems/cheatset-1.2.19/lib/cheatset.rb:4:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/cheatset-1.2.19/lib/cheatset.rb:4:in `<top (required)>'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:69:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/cheatset-1.2.19/bin/cheatset:4:in `<top (required)>'
    from /usr/bin/cheatset:23:in `load'
    from /usr/bin/cheatset:23:in `<main>'

My Ruby version is 2.2.0

% rbenv local
2.2.0

Add a way to insert spaces into notes

Currently there is no way to, for instance, demonstrate output containing spaces in notes:

Output: `something        with spaces`

Becomes this:

Output: something with spaces

Markdown list doesn't work

With following code:

    category do
      id 'List'
      entry do
        name 'List sample'
        notes <<-'END'
          Here's a list:
          - red
          - green
          - blue
          Another paragraph.
        END
      end
    end

I expect to see an unordered list, instead of showing them in one line:
image

Same issue for ordered list.

Exception occurs when trying to generate a cheatset

It said I successfully installed cheatset (had to follow the steps on issue #2), and when I try to generate the sample docset you guys gave, it throws this exception.

Daniels-MacBook-Air:cheatset danielryan$ cheatset generate sample.rb 
/usr/local/Cellar/ruby/2.1.1/lib/ruby/2.1.0/fileutils.rb:1573:in `stat': No such file or directory @ rb_file_s_stat - ./resources_dir (Errno::ENOENT)
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/2.1.0/fileutils.rb:1573:in `block in fu_each_src_dest'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/2.1.0/fileutils.rb:1587:in `fu_each_src_dest0'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/2.1.0/fileutils.rb:1571:in `fu_each_src_dest'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/2.1.0/fileutils.rb:440:in `cp_r'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/cheatset-1.2.10/lib/cheatset/creator.rb:48:in `generate_html_file'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/cheatset-1.2.10/lib/cheatset/creator.rb:19:in `generate'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/cheatset-1.2.10/lib/cheatset/dsl/context.rb:9:in `generate'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/cheatset-1.2.10/lib/cheatset/cli.rb:8:in `generate'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/cheatset-1.2.10/bin/cheatset:6:in `<top (required)>'
    from /usr/local/opt/ruby/bin/cheatset:23:in `load'
    from /usr/local/opt/ruby/bin/cheatset:23:in `<main>'

It looks fine when I view the created index.html with chrome within the Sample.docset directory,
but when I try to load it into dash, it says:

"The docset does not have a index file.
Maybe the docset has not been indexed? This is most likely an improperly downloaded
docset. Manually delete the docset and redownload it."

Unicode Cheatsheet

I just wonder if anyone could create the unicode cheat sheet which could be easily searched in Dash.app and update automatically, that would be wonderful.

I just don't know if there is an automatically method to generate this cheat sheet? Manually input the unicode table would be a disaster.

Any suggestion or reply?

Cheers

Error while generating : undefined method `to_hash'

Hi,

Cheatset installation was successful but generating the provided example sample.rb fails.

Versions used

macOS 12.6.2
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin21]
gem 3.4.1

$ gem which cheatset
~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset.rb
$ gem which temple
~/.gem/ruby/3.2.0/gems/temple-0.9.1/lib/temple.rb

Error

$ cheatset generate sample.rb
~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/dsl/base.rb:21: warning: undefining the allocator of T_DATA class Redcarpet::Markdown
~/.gem/ruby/3.2.0/gems/temple-0.9.1/lib/temple/map.rb:87:in `validate_map!': undefined method `to_hash' for "!!!\n%html\n  %head\n    %meta{charset: 'utf-8'}\n    %title= title\n    %link{rel: 'stylesheet', href: 'style.css'}\n    - if style\n      %style{type: 'text/css'}= style\n    - if head_inject\n      = head_inject\n    - categories.each do |category|\n      %link{href: \"//dash_ref/Category/\#{category.id.strip.gsub(/\\//, '%2F')}/1\"}\n      - category.hasEntry(false)\n      - category.entries.each_with_index do |entry, index|\n        - if entry.name || entry.index_name\n          - category.hasEntry(true)\n          %link{href: \"//dash_ref_\#{category.id.strip.gsub(/\\//, '%2F')}/Entry/\#{(entry.name) ? entry.tags_stripped_name.strip.gsub(/\\//, '%2F') : entry.index_name.strip.gsub(/\\//, '%2F')}/0\"}\n        - elsif entry.command && entry.command.length > 0\n          - category.hasEntry(true)\n          %link{href: \"//dash_ref_\#{category.id.strip.gsub(/\\//, '%2F')}/Command/\#{entry.command.first.strip.gsub(/\\//, '%2F')}/0\"}\n      - if !category.hasEntry\n        %link{href: \"//dash_ref/Entry/\#{category.id.strip.gsub(/\\//, '%2F')}/0\"}\n\n  %body\n    %header\n      %h1= title\n\n    %article\n      %p~ introduction\n\n      - categories.each do |category|\n        %section.category{class: category.html_class}\n          - if !category.hasEntry\n            %a{name: \"//dash_ref/Entry/\#{category.id.strip.gsub(/\\//, '%2F')}/0\"}\n          %h2{id:\"//dash_ref/Category/\#{category.id.strip.gsub(/\\//, '%2F')}/1\"}\n            = category.id\n          %div.scrollable\n            %table\n              - if category.header\n                %tr\n                  - category.header.each do |header|\n                    %th~ header\n\n              - category.entries.each_with_index do |entry, index|\n                %tr{id: ((entry.name || entry.index_name) ? \"//dash_ref_\#{category.id.strip.gsub(/\\//, '%2F')}/Entry/\#{(entry.name) ? entry.tags_stripped_name.strip.gsub(/\\//, '%2F') : entry.index_name.strip.gsub(/\\//, '%2F')}/0\" : \"//dash_ref_\#{category.id.strip.gsub(/\\//, '%2F')}/Command/\#{entry.command.first.strip.gsub(/\\//, '%2F')}/0\" if (entry.name || entry.index_name || (entry.command && entry.command.length > 0)) )}\n                  - if entry.command\n                    %td.command\n                      - entry.command.each do |command|\n                        %p\n                          %code= CGI.escapeHTML(command)\n                  - if entry.td_command\n                    - entry.td_command.each do |command|\n                      %td.td_command\n                        - if !command.empty?\n                          %code= CGI.escapeHTML(command)\n                  - if entry.name || entry.notes || entry.html_notes\n                    %td.description{:colspan => (\"2\" unless entry.command || entry.td_command || entry.td_notes)}\n                      .name~ entry.name\n                      .notes~ entry.notes\n                      .notes~ entry.html_notes\n                  - if entry.td_notes\n                    - entry.td_notes.each do |notes|\n                      %td.td_notes\n                        - if !notes.empty?\n                          .td_notes~ notes\n      - if notes\n        %section.notes\n          %h2 Notes\n          ~ notes\n    %footer\n      - if source_url\n        You can modify and improve this cheat sheet <a onclick=\"window.dash.openExternal_(this.href); return false;\" href=\"\#{source_url}\">here</a>\n      - else\n        Generated with <a onclick=\"window.dash.openExternal_(this.href); return false;\" href='https://github.com/Kapeli/cheatset#readme'>cheatset</a>":String (NoMethodError)

      map.to_hash.keys.each {|key| validate_key!(key) }
         ^^^^^^^^
Did you mean?  to_s
	from ~/.gem/ruby/3.2.0/gems/temple-0.9.1/lib/temple/mixins/options.rb:81:in `initialize'
	from ~/.gem/ruby/3.2.0/gems/temple-0.9.1/lib/temple/engine.rb:45:in `initialize'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/creator.rb:34:in `new'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/creator.rb:34:in `generate_html_file'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/creator.rb:20:in `generate'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/dsl/context.rb:9:in `generate'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/lib/cheatset/cli.rb:27:in `generate'
	from ~/.gem/ruby/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from ~/.gem/ruby/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from ~/.gem/ruby/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from ~/.gem/ruby/3.2.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from ~/.gem/ruby/3.2.0/gems/cheatset-1.4.6/bin/cheatset:6:in `<top (required)>'
	from ~/.gem/ruby/3.2.0/bin/cheatset:25:in `load'
	from ~/.gem/ruby/3.2.0/bin/cheatset:25:in `<main>'

Did I forget to install a dependency? Thank you for your help

small error in installation command

the README.MD specifies the command line options --no-ri and --no-rdoc.
This would not work on my mac but as it turns out there should only a sinlge dash instead of two in front of each option -no-ri and -no-rdoc.

This is therefore the command I had to use:

sudo gem install cheatset -no-ri -no-rdoc

While I'm at it, here's a quick side note, from me not being a big gem or ruby user. I had another issue first that talked about SSL certif issues. As it turns out my version of ruby was outdated and didn't have valid root CA certifs anymore. Doing a brew install ruby
(for more on this issue see this reference).
On my MacBookPro I was expecting the same issue and it looked that way but there a fast brew link ruby was enough. Homebrew will also tell you to add the ruby directory to your $PATH if that's not yet the case.
You can check all is good with this command: ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'

HTML Forms cheat sheet

@Kapeli I'm planning on making an HTML Forms cheat sheet but couldn't settle on a good format.

Any suggestions for a good layout and if you think it will be useful enough to add into the Dash cheat sheet list?

Unable to install cheatset

I'm a total noob when it comes to Ruby, so sorry if this is one of those issues. Below is the error I get when I try to install cheatset.

sudo gem install cheatset
Building native extensions. This could take a while...
ERROR: Error installing cheatset:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

creating Makefile

make "DESTDIR="
compiling autolink.c
compiling buffer.c
buffer.c:104:45: warning: passing 'const struct buf ' to parameter of type 'struct buf *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
if (buf->size + 1 <= buf->asize || bufgrow(buf, buf->size + 1) == 0) {
^~~
buffer.c:53:21: note: passing argument to parameter 'buf' here
bufgrow(struct buf *buf, size_t neosz)
^
1 warning generated.
compiling houdini_href_e.c
compiling houdini_html_e.c
compiling html.c
compiling html_smartypants.c
compiling markdown.c
compiling rc_markdown.c
compiling rc_render.c
compiling stack.c
linking shared-object redcarpet.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *
* [redcarpet.bundle] Error 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/redcarpet-3.1.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/redcarpet-3.1.1/ext/redcarpet/gem_make.out

-> ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

-> gem --version
2.0.3

Type and Name use different vertical orientation

I am working on something where I want command, name, and notes to be in separate columns. Thus my .rb file looks something like this:

    entry do
      command 'command'
      name 'name'
      td_notes <<-'END'
        Some text describing the code about to display

        ```
        some code
        ```

        Some more text describing the next set of code. This might be a length description, so it might wrap to a couple of lines or more when displayed in Dash.

        ```
        some code
        ```
      END
    end

The problem with the above is that Dash renders "command" at the top of the first column, while "name" appears centered in the second column. This is visually very jarring, and makes it hard to read.
It would be more aesthetically pleasing (and easier to read) if they were both using the same orientation, i.e. both at the top, or both centered. (I would personally choose centered.) Even if there were multiple commands (I'm not going to have that, but I understand the need to support it), they could still be centered vertically within the space.

Thanks!

Image embed

Hi Bogdan,

I had created an images embed posting in this section 2 days back but did not see them here so just creating a new one to give you an update on the questions you had for me. I am not really sure if the old issue still exists so please delete this one after you read this.

What I was trying to do was to embed this cheat sheet - http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/
I am still debating if adding the images from the site would be beneficial but just wanted to check what methods I had to do so.

Thanks for creating Dash! It has made my life simpler.

Regards
Deepu

Is it possible to turn off markdown?

Hi! My cheat sheet's notes have non-trivial HTML content and is screwed up when cheatset tries to be helpful and interpret parts of it as Markdown. Is there a way to prevent that? Thank you!

Examples:

  • I have HTML <code>*bold*</code> and expect to see *bold*, instead I see bold

This html:

<code>```&lt;language&gt; ... ```</code>

is displayed as &lt;language&gt; ... instead of:

```<language> ... ```

This HTML:

    <pre>[source]
    ----
    clojure, SQL     ;  <b class="conum">(1)</b>
    C-like           // <b class="conum">(2)</b>
    Python etc.      #  <b class="conum">(3)</b>
    XML              &lt;!--<b class="conum">(4)</b>--&gt;
    # Include from a file, specific lines only (-1 = until the end):
    include::filename.txt[lines=7;14..25;30..-1]
    
    # or include regions between tags; also, un-indent:
    include::lib/app.rb[tag=mytag,indent=0]
    ----
    &lt;1&gt; callout
    &lt;2&gt; callout
    &lt;3&gt; callout
    &lt;4&gt; callout</pre>

is turned into something completely different:

    <p></p>
    
    <h2><pre>[source]</pre></h2>
    
    <p>clojure, SQL     ;  <b class="conum">(1)</b>
    C-like           // <b class="conum">(2)</b>
    Python etc.      #  <b class="conum">(3)</b>
    XML              &lt;!--<b class="conum">(4)</b>--&gt;</p>
    
    <h1>Include from a file, specific lines only (-1 = until the end):</h1>
    
    <p>include::filename.txt[lines=7;14..25;30..-1]</p>
    
    <h1>or include regions between tags; also, un-indent:</h1>
    
    <h2>include::lib/app.rb[tag=mytag,indent=0]</h2>
    
    <p>&lt;1&gt; callout
    &lt;2&gt; callout
    &lt;3&gt; callout
    &lt;4&gt; callout
    </p>

and screws up totally the formatting of the rest of the document.

Does this work on Windows?

Hi, I'm a new user of 'Dash' on Windows
I just found that Windows has an app that supports Dash docsets - Velocity and Zeal
I wanted to generate my own cheatsets
Is this possible on Windows? (I see written that xcode is necessary)

Thanks,
David

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.