Browse Source

using css overrides to restrict wide content resizing the pdf canvas

css overrides to restrict wide content resizing the pdf canvas

pdf manual building using ruby1.9, ci integration, cosmetics.

fixed typo

debugging travis build env

upload script bugfixes, fighting ruby env

fighting ruby env

fighting ruby env

fighting ruby env
master
pulsar 10 years ago
committed by Paul Rogalinski
parent
commit
e6006232c8
  1. 29
      .travis.sh
  2. 47
      .travis.yml
  3. 36
      build_docs.sh
  4. 9
      docs/development/Building Manual.md
  5. 8
      docs/override.css
  6. 22
      support/buildserver/upload.php

29
.travis.sh

@ -9,6 +9,30 @@ TARGET_FILE=obj/cleanflight_${TARGET}
if [ $RUNTESTS ] ; then
cd ./src/test && make test
# A hacky way of running the unit tests at the same time as the normal builds.
elif [ $PUBLISHDOCS ] ; then
if [ $PUBLISH_URL ] ; then
#sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems zlib1g-dev libssl-dev
sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm
# rvmsudo gem1.9.1 install gimli
#rvmsudo rvm package install openssl
#rvmsudo rvm install 1.9.3-p551 -j 4
#rvmsudo rvm use --default 1.9.3-p551
rvmsudo gem install gimli
./build_docs.sh
curl -k \
--form "manual=@docs/Manual.pdf" \
--form "revision=${REVISION}" \
--form "branch=${BRANCH}" \
--form "last_commit_date=${LAST_COMMIT_DATE}" \
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
${PUBLISH_URL}
fi
elif [ $PUBLISHMETA ] ; then
if [ $PUBLISH_URL ] ; then
RECENT_COMMITS=$(git shortlog -n25)
@ -20,13 +44,14 @@ elif [ $PUBLISHMETA ] ; then
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
${PUBLISH_URL}
fi
else
if [ $PUBLISH_URL ] ; then
make -j2
if [ -f ${TARGET_FILE}.bin ] ; then
TARGET_FILE=${TARGET_FILE}.bin
TARGET_FILE=${TARGET_FILE}.bin
elif [ -f ${TARGET_FILE}.hex ] ; then
TARGET_FILE=${TARGET_FILE}.hex
TARGET_FILE=${TARGET_FILE}.hex
else
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
exit 1

47
.travis.yml

@ -1,25 +1,30 @@
env:
- RUNTESTS=True
- PUBLISHMETA=True
- TARGET=CC3D
- TARGET=CC3D OPBL=yes
- TARGET=CHEBUZZF3
- TARGET=CJMCU
- TARGET=EUSTM32F103RC
- TARGET=SPRACINGF3
- TARGET=NAZE
- TARGET=NAZE32PRO
- TARGET=OLIMEXINO
- TARGET=PORT103R
- TARGET=SPARKY
- TARGET=STM32F3DISCOVERY
- TARGET=ALIENWIIF1
- TARGET=ALIENWIIF3
# - RUNTESTS=True
# - PUBLISHMETA=True
- PUBLISHDOCS=True
# - TARGET=CC3D
# - TARGET=CC3D OPBL=yes
# - TARGET=CHEBUZZF3
# - TARGET=CJMCU
# - TARGET=EUSTM32F103RC
# - TARGET=SPRACINGF3
# - TARGET=NAZE
# - TARGET=NAZE32PRO
# - TARGET=OLIMEXINO
# - TARGET=PORT103R
# - TARGET=SPARKY
# - TARGET=STM32F3DISCOVERY
# - TARGET=ALIENWIIF1
# - TARGET=ALIENWIIF3
# We use cpp for unit tests, and c for the main project.
language: cpp
compiler: clang
before_install:
rvm:
- 1.9.1
before_install:
- sudo apt-get update
- wget "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2"
@ -31,7 +36,7 @@ install:
before_script: arm-none-eabi-gcc --version
script: ./.travis.sh
notifications:
irc: "chat.freenode.net#cleanflight"
use_notice: true
skip_join: true
#notifications:
# irc: "chat.freenode.net#cleanflight"
# use_notice: true
# skip_join: true

36
build_docs.sh

@ -2,12 +2,12 @@
filename=Manual
doc_files=(
'Introduction.md'
'Safety.md'
'Installation.md'
'Configuration.md'
'Cli.md'
'Serial.md'
'Introduction.md'
'Safety.md'
'Installation.md'
'Configuration.md'
'Cli.md'
'Serial.md'
'Rx.md'
'Spektrum bind.md'
'Failsafe.md'
@ -17,23 +17,23 @@ doc_files=(
'Telemetry.md'
'LedStrip.md'
'Display.md'
'Buzzer.md'
'Buzzer.md'
'Sonar.md'
'Profiles.md'
'Modes.md'
'Inflight Adjustments.md'
'Controls.md'
'Modes.md'
'Inflight Adjustments.md'
'Controls.md'
'Autotune.md'
'Blackbox.md'
'Migrating from baseflight.md'
'Boards.md'
'Board - AlienWii32.md'
'Board - CC3D.md'
'Board - CJMCU.md'
'Board - Naze32.md'
'Board - Sparky.md'
'Board - Olimexino.md'
'Board - CheBuzzF3.md'
'Board - AlienWii32.md'
'Board - CC3D.md'
'Board - CJMCU.md'
'Board - Naze32.md'
'Board - Sparky.md'
'Board - Olimexino.md'
'Board - ChebuzzF3.md'
)
if which gimli >/dev/null; then
@ -47,7 +47,7 @@ if which gimli >/dev/null; then
cat "$i" >> ${filename}.md
done
rm -f ${filename}.pdf
gimli -f ${filename}.md
gimli -f ${filename}.md -stylesheet override.css
rm ${filename}.md
popd >/dev/null
else

9
docs/development/Building Manual.md

@ -5,8 +5,8 @@ The manual PDF file is generated by concatenating relevant markdown files and by
##Requrements & Installation
The PDF manual generation uses the Gimli for the conversion. It can be installed via ruby gems. On Debian based systems the installation steps are:
```bash
sudo aptitude install rubygems wkhtmltopdf libxml2-dev libxslt-dev
sudo gem1.8 install gimli
sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems zlib1g-dev wkhtmltopdf libxml2-dev libxslt-dev
sudo sudo gem1.9.1 install gimli
```
##Configuration
@ -17,7 +17,4 @@ doc_files=( 'Configuration.md'
'...'
'...'
)
```
##Restritions
As the conversion via Gimli will not respect embedded image's DPI settings, the diemnsions of the image will be defined by the physical resolution in pixels. As a rule of thumb one should not embedd images wider than 600px in the markdown files.
```

8
docs/override.css

@ -0,0 +1,8 @@
IMG {
max-width: 700px;
}
/* mainly for the cli reference table */
TABLE TR TD, TABLE TR TH {
font-size: 9px
}

22
support/buildserver/upload.php

@ -3,7 +3,9 @@
$baseDir = "/var/www/builds/";
$myFile = $_FILES["file"];
$firmwareFile = $_FILES["file"];
$manualFile = $_FILES["manual"];
$recentCommits = $_POST["recent_commits"];
$travisJobId = sanitize($_POST["travis_build_number"]);
$lastCommitDate = sanitize($_POST["last_commit_date"]);
@ -13,11 +15,21 @@
$uploadDir = $baseDir . "/" . $lastCommitDate . "/";
$prefix = $uploadDir . $travisJobId . "_" . $revision;
if(!file_exists($uploadDir)) mkdir($uploadDir, 0660, true);
if(!file_exists($uploadDir)) mkdir($uploadDir, 0770, true);
if($firmwareFile) {
$uploadfile = $prefix . "_" . (basename($firmwareFile['name']));
if(move_uploaded_file($firmwareFile['tmp_name'], $uploadfile)) {
echo "upload succeeded.\n";
}
else {
echo "upload failed $uploadfile\n";
}
}
if($myFile) {
$uploadfile = $prefix . "_" . (basename($myFile['name']));
if(move_uploaded_file($myFile['tmp_name'], $uploadfile)) {
if($manualFile) {
$uploadfile = $prefix . "_" . (basename($manualFile['name']));
if(move_uploaded_file($manualFile['tmp_name'], $uploadfile)) {
echo "upload succeeded.\n";
}
else {

Loading…
Cancel
Save