Skip to content

Ebook version 0.1, closes #449#458

Closed
elbaulp wants to merge 1 commit intogithub:gh-pagesfrom
elbaulp:ebook-version
Closed

Ebook version 0.1, closes #449#458
elbaulp wants to merge 1 commit intogithub:gh-pagesfrom
elbaulp:ebook-version

Conversation

@elbaulp
Copy link
Copy Markdown

@elbaulp elbaulp commented Oct 17, 2017

  • Have you followed the contributing guidelines?
  • Have you explained what your changes do, and why they add value to the Guides?

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.

This is a first attempt, the script could be improved.

Copy link
Copy Markdown
Contributor

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add CI tests to make sure that this continues to work. As a general comment I think Ruby may be better suited for this than Bash, particularly if we can't use Jekyll to e.g. remove front matter. Thanks for the PR, though!

Comment thread script/generate-ebook
cd tmp
cp ../../_articles/en-US/*.md .

## Remove the front matter
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if Jekyll could be utilised to do this for us?

Comment thread script/generate-ebook
@@ -0,0 +1,42 @@
#/bin/env bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#!/bin/bash or #!/usr/bin/env bash would be better here. Would also be good to add a set -e so errors aren't silently ignored.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd even suggest:

#! /usr/bin/env bash

if [ -n "$DEBUG" ]
then
  set -x
fi
set -euo pipefail
# ref: https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail

Comment thread script/generate-ebook
@@ -0,0 +1,42 @@
#/bin/env bash

# Author: #elbaulp
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can skip this; the git log will reveal you are author.

Comment thread script/generate-ebook
# Generate title
echo """
---
title: Opensource Guide
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open Source Guides

Comment thread script/generate-ebook
echo """
---
title: Opensource Guide
author: Github
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub and friends

Comment thread script/generate-ebook
---
title: Opensource Guide
author: Github
rights: Attribution 4.0 International
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creative Commons Attribution 4.0 International

@elbaulp
Copy link
Copy Markdown
Author

elbaulp commented Oct 18, 2017

Hi @MikeMcQuaid, I don't know Ruby, I could try in python, maybe.

@MikeMcQuaid
Copy link
Copy Markdown
Contributor

@elbaulp Leaving it in Bash should be fine but I'd rather something like a Rubygem was installed or used in that case rather than manual perl substitutions. Thanks!

@MikeMcQuaid
Copy link
Copy Markdown
Contributor

Passing on this as there's been no movement in almost 2 months, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants