neruda 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neruda/version.rb +1 -1
- metadata +24 -219
- data/LICENSE +0 -14
- data/bin/pablo +0 -193
- data/lib/neruda/config/lisp_config.rb +0 -260
- data/lib/neruda/config/org-config.el +0 -17
- data/lib/neruda/config/ox-neruda.el +0 -114
- data/lib/neruda/config.rb +0 -137
- data/lib/neruda/emacs.rb +0 -37
- data/lib/neruda/index/atom_generator.rb +0 -86
- data/lib/neruda/index/org_generator.rb +0 -114
- data/lib/neruda/index.rb +0 -130
- data/lib/neruda/org_file/class_methods.rb +0 -72
- data/lib/neruda/org_file/extracter.rb +0 -72
- data/lib/neruda/org_file/htmlizer.rb +0 -43
- data/lib/neruda/org_file.rb +0 -299
- data/lib/neruda/preview.rb +0 -55
- data/lib/neruda/templater.rb +0 -118
- data/lib/neruda/utils.rb +0 -214
- data/lib/tasks/org.rake +0 -91
- data/lib/tasks/site.rake +0 -55
- data/lib/tasks/sync.rake +0 -34
- data/lib/tasks/tags.rake +0 -19
- data/locales/en.yml +0 -38
- data/locales/fr.yml +0 -38
data/lib/tasks/org.rake
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'open-uri'
|
|
4
|
-
|
|
5
|
-
# Neruda::Config is required by Neruda::Utils
|
|
6
|
-
require 'neruda/utils'
|
|
7
|
-
|
|
8
|
-
require 'rake/clean'
|
|
9
|
-
|
|
10
|
-
CLOBBER.push(
|
|
11
|
-
'tmp/org.tar.gz', 'tmp/__last_org_version__',
|
|
12
|
-
'org-config.el', '.dir-locals.el', 'htmlize.el'
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
namespace :org do
|
|
16
|
-
desc 'Download last version of Org'
|
|
17
|
-
file 'tmp/org.tar.gz' do
|
|
18
|
-
verbose = Rake::FileUtilsExt.verbose_flag
|
|
19
|
-
download = Thread.new do
|
|
20
|
-
Thread.current[:org_version] = Neruda::Config.org_last_version
|
|
21
|
-
Neruda::Utils.download_org
|
|
22
|
-
end
|
|
23
|
-
if verbose
|
|
24
|
-
download.join
|
|
25
|
-
warn "Org version #{download[:org_version]} has been downloaded"
|
|
26
|
-
else
|
|
27
|
-
Neruda::Utils.throbber(download, 'Downloading Org:')
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
desc 'Compile Org'
|
|
32
|
-
task compile: 'tmp/org.tar.gz' do |task|
|
|
33
|
-
verbose = Rake::FileUtilsExt.verbose_flag
|
|
34
|
-
org_version = "org-#{Neruda::Config.org_last_version}"
|
|
35
|
-
next if Dir.exist?("#{org_version}/lisp")
|
|
36
|
-
make = ['make', '-C', org_version]
|
|
37
|
-
unless verbose
|
|
38
|
-
make << '-s'
|
|
39
|
-
make << 'EMACSQ="emacs -Q --eval \'(setq inhibit-message t)\'"'
|
|
40
|
-
end
|
|
41
|
-
build = Thread.new do
|
|
42
|
-
sh "tar xzf #{task.prerequisites[0]}"
|
|
43
|
-
sh((make + ['compile']).join(' '))
|
|
44
|
-
sh((make + ['autoloads']).join(' '))
|
|
45
|
-
Dir.glob('org-[0-9.]*').each do |ov|
|
|
46
|
-
next if ov == org_version
|
|
47
|
-
rm_r ov
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
if verbose
|
|
51
|
-
build.join
|
|
52
|
-
warn "#{org_version} has been locally installed"
|
|
53
|
-
else
|
|
54
|
-
Neruda::Utils.throbber(build, 'Installing Org:')
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
file 'htmlize.el' do
|
|
59
|
-
htmlize = URI(
|
|
60
|
-
'https://raw.githubusercontent.com/hniksic/emacs-htmlize/master/htmlize.el'
|
|
61
|
-
).open.read
|
|
62
|
-
IO.write 'htmlize.el', htmlize
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
file 'org-config.el' => 'htmlize.el' do
|
|
66
|
-
Neruda::Config.write_org_lisp_config
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
file '.dir-locals.el' do
|
|
70
|
-
Neruda::Config.write_dir_locals
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
desc 'Install Org'
|
|
74
|
-
multitask install: ['org:compile', 'org-config.el', '.dir-locals.el'] do
|
|
75
|
-
mkdir_p "#{Neruda::Config.settings['public_folder']}/assets"
|
|
76
|
-
Neruda::Config.sources.each do |s|
|
|
77
|
-
mkdir_p s['path'] unless Dir.exist? s['path']
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
# The following task only run the clobber task (not provided by us)
|
|
82
|
-
# and the org:install one, which is already tested. Thus, we can
|
|
83
|
-
# safely remove it from coverage.
|
|
84
|
-
# :nocov:
|
|
85
|
-
desc 'Upgrade Org'
|
|
86
|
-
task :upgrade do
|
|
87
|
-
Rake::Task['clobber'].execute
|
|
88
|
-
Rake::Task['org:install'].invoke
|
|
89
|
-
end
|
|
90
|
-
# :nocov:
|
|
91
|
-
end
|
data/lib/tasks/site.rake
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'neruda/emacs'
|
|
4
|
-
require 'neruda/index'
|
|
5
|
-
require 'neruda/utils'
|
|
6
|
-
require 'neruda/org_file'
|
|
7
|
-
require 'neruda/templater'
|
|
8
|
-
|
|
9
|
-
namespace :site do
|
|
10
|
-
desc 'Generates all index files'
|
|
11
|
-
task :index do
|
|
12
|
-
index = Neruda::Index.new
|
|
13
|
-
verbose = Rake::FileUtilsExt.verbose_flag
|
|
14
|
-
if verbose
|
|
15
|
-
index.write_all
|
|
16
|
-
next
|
|
17
|
-
end
|
|
18
|
-
build = Thread.new do
|
|
19
|
-
index.write_all(verbose: false)
|
|
20
|
-
end
|
|
21
|
-
Neruda::Utils.throbber(build, 'Generating indexes:')
|
|
22
|
-
next if index.empty?
|
|
23
|
-
Neruda::Config.write_org_lisp_config(with_tags: true)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
desc 'Convert and customize all org files'
|
|
27
|
-
task :build, [:force?] => ['org-config.el', :index] do |_, args|
|
|
28
|
-
args.with_defaults(:force? => false)
|
|
29
|
-
build_html = Thread.new do
|
|
30
|
-
rm_r 'tmp/timestamps', force: true if args[:force?]
|
|
31
|
-
Neruda::Emacs.new(verbose: Rake::FileUtilsExt.verbose_flag).publish
|
|
32
|
-
end
|
|
33
|
-
begin
|
|
34
|
-
Neruda::Utils.throbber(build_html, 'Building:')
|
|
35
|
-
# :nocov:
|
|
36
|
-
rescue RuntimeError
|
|
37
|
-
warn 'Aborting'
|
|
38
|
-
next
|
|
39
|
-
end
|
|
40
|
-
# :nocov:
|
|
41
|
-
customize_html = Thread.new do
|
|
42
|
-
pubfolder = Neruda::Config.settings['public_folder']
|
|
43
|
-
Dir["#{pubfolder}/**/*.html"].each do |f|
|
|
44
|
-
Neruda::Templater.customize_output(f)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
Neruda::Utils.throbber(customize_html, 'Customizing:')
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
desc 'Start a test server'
|
|
51
|
-
task :preview do
|
|
52
|
-
require 'neruda/preview'
|
|
53
|
-
Neruda.start_preview
|
|
54
|
-
end
|
|
55
|
-
end
|
data/lib/tasks/sync.rake
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'neruda/config'
|
|
4
|
-
require 'neruda/utils'
|
|
5
|
-
|
|
6
|
-
def rsync_command(verbose, test = nil)
|
|
7
|
-
rsync_command = Neruda::Config.settings['rsync']
|
|
8
|
-
return rsync_command unless rsync_command.nil?
|
|
9
|
-
optstring = []
|
|
10
|
-
optstring << 'n' if test
|
|
11
|
-
if verbose
|
|
12
|
-
optstring << 'v'
|
|
13
|
-
else
|
|
14
|
-
optstring << 'q'
|
|
15
|
-
end
|
|
16
|
-
"rsync -#{optstring.join}rlpD --delete"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
namespace :sync do
|
|
20
|
-
desc 'Push change to server'
|
|
21
|
-
task :push, :test? do |_, args|
|
|
22
|
-
remote_path = Neruda::Config.settings['remote']
|
|
23
|
-
if remote_path.nil?
|
|
24
|
-
warn 'No remote path set'
|
|
25
|
-
next
|
|
26
|
-
end
|
|
27
|
-
public_folder = Neruda::Config.settings['public_folder']
|
|
28
|
-
publish_thread = Thread.new do
|
|
29
|
-
sh [rsync_command(Rake::FileUtilsExt.verbose_flag, args[:test?]),
|
|
30
|
-
"#{public_folder}/", remote_path].join(' ')
|
|
31
|
-
end
|
|
32
|
-
Neruda::Utils.throbber(publish_thread, 'Publishing:')
|
|
33
|
-
end
|
|
34
|
-
end
|
data/lib/tasks/tags.rake
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'neruda/index'
|
|
4
|
-
|
|
5
|
-
namespace :tags do
|
|
6
|
-
desc 'List all tags by name'
|
|
7
|
-
task :name do
|
|
8
|
-
index = Neruda::Index.new
|
|
9
|
-
next if index.empty?
|
|
10
|
-
puts index.sort_by(:name).join("\n")
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
desc 'List all tags by weight'
|
|
14
|
-
task :weight do
|
|
15
|
-
index = Neruda::Index.new
|
|
16
|
-
next if index.empty?
|
|
17
|
-
puts index.sort_by(:weight).join("\n")
|
|
18
|
-
end
|
|
19
|
-
end
|
data/locales/en.yml
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
pablo:
|
|
3
|
-
error:
|
|
4
|
-
no_command: 'ERROR: no command or unknown command given.'
|
|
5
|
-
no_file: 'ERROR: no file to open or edit.'
|
|
6
|
-
usage: 'Usage: pablo %1 [options]'
|
|
7
|
-
commands:
|
|
8
|
-
cmd_title: Commands
|
|
9
|
-
alias: Alias for %1.
|
|
10
|
-
init: Initialize your Neruda instance (you just need to do it once).
|
|
11
|
-
preview: 'Start a test web server to preview your website on http://127.0.0.1:5000'
|
|
12
|
-
open: Open or create an org file.
|
|
13
|
-
build: Compile your org files to HTML.
|
|
14
|
-
publish: Push local changes to your public web server.
|
|
15
|
-
help: Alias for the -h switch.
|
|
16
|
-
options:
|
|
17
|
-
cmd_title: Options
|
|
18
|
-
path: Path to the new file.
|
|
19
|
-
directory: Wrap the new org file in this named folder.
|
|
20
|
-
help: Display help for a command and exit.
|
|
21
|
-
version: Display Neruda version and exit.
|
|
22
|
-
neruda:
|
|
23
|
-
error:
|
|
24
|
-
label: An error occured.
|
|
25
|
-
explanation: To see it, run again your command with more verbosity, i.e. pablo build -v
|
|
26
|
-
index:
|
|
27
|
-
unsorted: Unsorted
|
|
28
|
-
published_on: Published on %1
|
|
29
|
-
all_tags: All tags
|
|
30
|
-
by_name: By alphabetical order
|
|
31
|
-
by_weight: By publication number
|
|
32
|
-
full_date_format: '%A %{date}'
|
|
33
|
-
full_date_with_time_format: '%{date} at %{time}'
|
|
34
|
-
org:
|
|
35
|
-
postamble:
|
|
36
|
-
written_by: Written by %a
|
|
37
|
-
with_emacs: 'with %c, and published with %N'
|
|
38
|
-
last_modification: Last modification on %C
|
data/locales/fr.yml
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
pablo:
|
|
3
|
-
error:
|
|
4
|
-
no_command: 'ERREUR : Aucune commande ou commande inconnue donnée.'
|
|
5
|
-
no_file: 'ERREUR : Aucun fichier à ouvrir ou éditer.'
|
|
6
|
-
usage: 'Usage : pablo %1 [options]'
|
|
7
|
-
commands:
|
|
8
|
-
cmd_title: Commandes
|
|
9
|
-
alias: Alias pour %1.
|
|
10
|
-
init: Initialise votre instance de Neruda (vous ne devriez faire cela qu'une fois).
|
|
11
|
-
preview: "Démarre un serveur web de test pour prévisualiser votre site à l'adresse http://127.0.0.1:5000"
|
|
12
|
-
open: Ouvre ou crée un fichier org.
|
|
13
|
-
build: Compile vos fichiers org en HTML.
|
|
14
|
-
publish: Pousse vos changements locaux vers votre serveur web public.
|
|
15
|
-
help: Alias pour l'argument -h.
|
|
16
|
-
options:
|
|
17
|
-
cmd_title: Options
|
|
18
|
-
path: Chemin vers le nouveau fichier.
|
|
19
|
-
directory: Place le nouveau fichier org dans un dossier à ce nom.
|
|
20
|
-
help: Affiche l'aide pour une commande et quitte.
|
|
21
|
-
version: Affiche la version de Neruda et quitte.
|
|
22
|
-
neruda:
|
|
23
|
-
error:
|
|
24
|
-
label: Une erreur est survenue
|
|
25
|
-
explanation: Pour voir le détail, lancez de nouveau la commande avec plus de verbosité, par exemple pablo build -v
|
|
26
|
-
index:
|
|
27
|
-
unsorted: Non triés
|
|
28
|
-
published_on: Publié le %1
|
|
29
|
-
all_tags: Toutes les étiquettes
|
|
30
|
-
by_name: Par ordre alphabétique
|
|
31
|
-
by_weight: Par nombre de publication
|
|
32
|
-
full_date_format: '%A %{date}'
|
|
33
|
-
full_date_with_time_format: '%{date} à %{time}'
|
|
34
|
-
org:
|
|
35
|
-
postamble:
|
|
36
|
-
written_by: Écrit par %a
|
|
37
|
-
with_emacs: 'avec %c et publié avec %N'
|
|
38
|
-
last_modification: dernière modification le %C
|