jeffreytse / jekyll-spaceship

🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
MIT License
606 stars 63 forks source link

Not all md files are treated #8

Closed SebastienAndreo closed 3 years ago

SebastienAndreo commented 4 years ago

Hello,

first of all a really nice plugin, table processing is really useful!

I am not sure if my request is a bug or a feature, I would like to share with you my experience. I have configured the table in my project and in the build log, the following files appear to be treated:

  Jekyll Spaceship: [TableProcessor] _pages/about.md
  Jekyll Spaceship: [TableProcessor] _pages/withprocessor.md

But I have other collections containing other files that are not treated at all. Is there a way to indicate which folder should be treated and which one should not?

jeffreytse commented 4 years ago

Hi @SebastienAndreo

You should explicitly included the folder to the include: section of _config.yml file , otherwise the pages of the folder would not be treated.

Thanks for your support.

brigitte-youitv commented 4 years ago

Hi! Thank you for this amazing plugin! 🎉

I'm having a similar problem as described above. My site doesn't use pages, my markdown files are all in a collection (_docs). The pages in my collection appear without a problem, but it unfortunately the table processor isn't scraping those folders.

Here's the output from bundle exec jekyll serve:

Jekyll Spaceship: 🚀 Jekyll-Spaceship 0.6.1
  Jekyll Spaceship: 🎉 A Jekyll plugin to provide powerful supports.
  Jekyll Spaceship: 👉 https://github.com/jeffreytse/jekyll-spaceship
  Jekyll Spaceship: 🗂  use table-processor
  Jekyll Spaceship: 🗂  use mathjax-processor
  Jekyll Spaceship: 🗂  use plantuml-processor
  Jekyll Spaceship: 🗂  use polyfill-processor
  Jekyll Spaceship: 🗂  use video-processor
  Jekyll Spaceship: 🗂  use emoji-processor
Configuration file: /Users/me/project/_config.yml
 Theme Config file: /usr/local/lib/ruby/gems/2.6.0/bundler/gems/my-project-theme/_config.yml
            Source: /Users/me/project
       Destination: /Users/me/project/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.87 seconds.
 Auto-regeneration: enabled for '/Users/me/project'
    Server address: http://127.0.0.1:4001/project/
  Server running... press ctrl-c to stop.

On my site I had added one of your table examples to my page and it looks like this:

image

Taking your suggestion from above, I tried adding _docs to my include: section in the _config.yml, but that didn't make a difference (I restarted the server after making the changes).

include:
  - _docs/

Any thoughts?

EDIT: I decided to make sure the plugin was working and I added the same table to my main index.markdown file, and that one is properly processed, and appears with merged cells, as expected:

       Jekyll Feed: Generating feed for posts
  Jekyll Spaceship: [TableProcessor] index.markdown
jeffreytse commented 4 years ago

Hi, @brigitte-youitv

Thank you for your support! 🎉

According to your description, the collection folder should be included and end without a slash strictly. The code is as below:

include:
  - _docs

There are some awesome features in planning. Welcome to star this project for more amazing features in future.

Thanks with regards.

brigitte-youitv commented 4 years ago

Thank you for your support @jeffreytse!

Goodness me, you're right, I needed to include it without the end slash. For anyone else running into the same issue, this is the normal include section of the _config.yml, nothing special in the jekyll-spaceship.

So... now I have the processing message for my file in the collection.

 Jekyll Spaceship: [TableProcessor] index.markdown
  Jekyll Spaceship: [TableProcessor] _docs/markdown/md-overview.md

But the only the table in index.markdown looks right, the other still has the ^^ in it, even after I hard-refresh the page or visit it in an incognito browser.

I'll try to make a tiny jekyll project to try to show you what I mean.

brigitte-youitv commented 4 years ago

Steps to repro:

jekyll new spaceship
cd spaceship
vi index.markdown    # add a table. I'm using the one with Glycolysis in row 2 column 1
mdkir _docs
cp index.markdown _docs/test.md
vi Gemfile     # add "  gem 'jekyll-spaceship'   " in the jekyll_plugins group

Then, edit _config.yml and add the line after jekyll-feed that should already be there:

plugins:
  - jekyll-feed
  - jekyll-spaceship

include:
  - _docs     # this isn't needed for jekyll to process the collection, but jekyll-spaceship needs it

collections:
  docs:
    output: true
    permalink: /:path/     # must end in '/'

Run bundle exec jekyll serve and go to http://127.0.0.1:4000/ and http://127.0.0.1:4000/test/. Note that the first one has the expected formatting for the table and the second one doesn't.

I hope that helps! I have the package zipped up here too, if you'd prefer. I have one more level of folders in my test because I wanted to test markdown/md-overview.md as well.

spaceship.zip

jeffreytse commented 4 years ago

Hi @brigitte-youitv

Thank you for the tiny project to show me what you mean. And the issue that collections are not treated is addressed.

Thanks with regards

jeffreytse commented 4 years ago

Hi @SebastienAndreo , @brigitte-youitv

🎉 The latest gem version v0.6.2 has been released.

Thanks and regards

brigitte-youitv commented 4 years ago

Amazing! Thank you so much. I upgraded and it worked. I can even remove the extraneous include for the collections folder.

❤️ thank you for the amazing support!