Using Github for version control of Jade databases. difference inspection for .scm does not work even though the files can be read as legible .txt files
Any way to tell github to treat a file as a .txt for diff checking or similar
I use other API to upload MD to github's directory, and trigger workflow for follow-up work
I need to add a section to the workflow to find files and rename the files, replace some characters with the current date, I tried adding sed, find commands, but it doesn't work, what should I do?
enter image description here
I am trying to create a patch file by comparing Drupal projects on a project level, not on the individual file level, by using the Unix terminal command 'diff'.
Here is the syntax:
diff drupalprojectv1 drupalprojectv2 > patch.patch
When I view the patch file, all I see is the differences between the directories and subdirectories, changes in codes in individual files are not compared. If I do it with individual files, such as
diff somefile1.html.twig somefile2.html.twig > patch.patch
then I can see the difference and the patch can be applied successfully.
Is there any way a patch file can be created on a project level, instead of just between individual files without using Git?
Try
diff -ruN drupalprojectv1 drupalprojectv2 > patch.patch
Refer to diff examples and documentation for more details
Is it possible to render a .ipynb file on github the way .md files are rendered? Basically I am asking if it somehow possible to embed the notebook viewer
GitHub supports several formats for README-type files, but IPython notebooks aren't listed among them.
If you are trying to do this with GitHub Pages (static sites hosted on GitHub), manually converting your notebooks to HTML with nbconvert might be useful:
ipython nbconvert --to html --template full notebook.ipynb
This should output an HTML file and a directory containing images and other files.
If you have LaTeX formulas, they should be handled client-side with MathJax.
I created a wonderful GitHub Pages website for my little project, and I added some other pages into the gh-pages branch.
My problem is that, everytime I regenerate the website from 'Settings=>Automatic Page Generator', everything is cleaned up and I have to restore the files manually.
Is there a way to prevent, or work around this?
It would have been much better if the Automatic Generator was just overwriting his stuff without removing existing files.
Checkout the gh-pages branch.
mkdir _layouts
move index.html to _layouts
edit _layouts/index.html replace the the inner html of the contents section with {{content}}
make new file index.md
Paste markdown content of automatic page generator into index.md
prepend the following to index.md
---
layout: index
---
create _config.yml
include the following in _config.yml:
markdown: kramdown
kramdown:
auto_ids: true
this step is to match github's markdown syntax
add & commit changes, and then push branch back to github.
Now you can simply edit index.md from the gh-branch in your github source browser and it will update using jekyll automatically and not mess with anything in your gh-branch.
You can also make more items editable in the layout using place holder {{page.varname}} and then adding varname:your text to the header of your index.md.
Well, after some tries I found the solution.
I noticed that the only file changed for my site was the index.html, the rest of the generated site was the same. Inside the index.html there was a <section>content</section> tag that was containing the html generated from the markdown.
So I created two files header.inc and footer.inc, that contained the "static" part for the index page. The content part should have been generated from the README.md file.
I found that there is an API provided by github to render a RAW markdown in raw mode to html.
So, last piece of the puzzle was to obtain a permalink for the README.md of my project, with the RAW content; which I happened to find here.
So I wrote this simple bash script that regenerates the index.html alone, without touching the rest of the site:
#!/bin/sh
PG_DIR=$(dirname $0)
RAW_README_URL=https://raw.github.com/lviggiano/owner/master/README.md
GITHUB_API_URL=https://api.github.com/markdown/raw
cat $PG_DIR/header.inc
curl -s $RAW_README_URL | curl -s --data-binary #- -H 'Content-Type: text/plain' $GITHUB_API_URL
cat $PG_DIR/footer.inc
Then I just launch the script as:
$ cd myproject
$ git checkout gh-pages
$ git pull origin gh-pages:gh-pages
$ ./bin/autogen > index.html
$ git commit -m "updated index.html from latest README.md" index.html
$ git push origin gh-pages:gh-pages
See the implementation details here.
I tested with the "Leap Day" layout; but I suppose it works also for the others.
No, not possible. GitHub wipes the gh-pages repository when you do a "generate". Best you can do is what you are doing now. Another option might be not to use the GitHub page generator to change styles, but to find the source of the styles (they're probably on GitHub somewhere) and manually change them by committing changes (substitute the css files and other minor tweaks)
You can configure Jekyll to skip certain directories with the exclude option.
(Note that Jekyll has a keep_files option -- that is for the files in the destintation directory.)