Das Scharwerk is distributed publishing system.
Book digitization workflow::
- Set up. Admin load book screenshots and raw scanned text.
- Proof reading. On this stage, users compare text in editor with scans.
- Latex markup. The text editor contain basic latex commands, for more specific tasks like tables use pure latex.
- Rails for backend and Angular 1 for frontend
- We use github as text storage, and version control system
- Login via Facebook only
- For background processing we use Sidekiq(it commits texts to github asynchronously)
-
Install rails http://railsapps.github.io/installing-rails.html
-
Install deps
bundler install
-
Run and go to http://localhost:3000/
rails s
Please, before push to github run in console, in your project folder:
rubocop
bundle exec rspec
rake db:migrate RAILS_ENV=test
If assets changed:
RAILS_ENV=production rake assets:clobber
RAILS_ENV=production rake assets:precompile
Connect via ssh:
Go to the project folder:
cd /home/rails/scharwerk
Config sidekiq. Copy upstart/sidekiq.conf to /etc/init/sidekiq.conf. Set the PASSWORD_GOES_HERE in file. Start by:
start sidekiq index=0
sudo service sidekiq restart index=0
Run Latex docker from root!
Logs in /var/log/upstart/sidekiq-0.log
Get new version:
git pull
Update project:
bundle install --deployment --without development test
. /etc/default/unicorn
RAILS_ENV=production rake db:migrate
If styling changed:
service unicorn restart
service nginx reload
Visit http://46.101.228.108/
How to use tex processing tools.
-
Add method into lib/tasks/tex_processing.rb, it is plain old ruby not a rake task
-
Run the task from console, you should be in specific folder /tools
ruby tex.rb <your_method_name> <path_plus_files_to_proceed>
ruby tex.rb fix_smith ~/projects/das-kapital/tex/ii/_\*.tex
-
clone text into
cd db/ mkdir git/ cd git/ git clone [email protected]:marx-in-ua/das-kapital.git . git checkout test
-
copy images to public/files/images/
-
Generate tasks:
. /etc/default/unicorn
RAILS_ENV=production rake scharwerk:generate_tasks['franko/*','test','franko',5]
RAILS_ENV=production rake scharwerk:generate_tasks['ii/','first_proof','book_2',5] RAILS_ENV=production rake scharwerk:generate_tasks['franko/','first_proof','franko',3] RAILS_ENV=production rake scharwerk:generate_tasks['iii.2/','first_proof','book_3_2',3] RAILS_ENV=production rake scharwerk:generate_tasks['i/','first_proof','book_1',5] RAILS_ENV=production rake scharwerk:generate_tasks['iii.1/','first_proof','book_3_1',5] RAILS_ENV=production rake scharwerk:generate_tasks_2['franko/','franko']
RAILS_ENV=production rake scharwerk:generate_tasks_3['franko/*','franko'] RAILS_ENV=production rake scharwerk:generate_tasks_3['i/','book_1'] RAILS_ENV=production rake scharwerk:generate_tasks_3['ii/_','book_2']
-
Unassigne abandoned tasks(without changes for 20 days)
RAILS_ENV=production rake scharwerk:unassign_tasks[20]
-
Console
. /etc/default/unicorn bin/rails console production