1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-13 03:19:58 +03:00

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
This commit is contained in:
pulsar 2015-04-03 16:02:12 +02:00 committed by Paul Rogalinski
parent 988ae2d503
commit e6006232c8
6 changed files with 99 additions and 52 deletions

View file

@ -9,6 +9,30 @@ TARGET_FILE=obj/cleanflight_${TARGET}
if [ $RUNTESTS ] ; then if [ $RUNTESTS ] ; then
cd ./src/test && make test 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 elif [ $PUBLISHMETA ] ; then
if [ $PUBLISH_URL ] ; then if [ $PUBLISH_URL ] ; then
RECENT_COMMITS=$(git shortlog -n25) RECENT_COMMITS=$(git shortlog -n25)
@ -20,13 +44,14 @@ elif [ $PUBLISHMETA ] ; then
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \ --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
${PUBLISH_URL} ${PUBLISH_URL}
fi fi
else else
if [ $PUBLISH_URL ] ; then if [ $PUBLISH_URL ] ; then
make -j2 make -j2
if [ -f ${TARGET_FILE}.bin ] ; then if [ -f ${TARGET_FILE}.bin ] ; then
TARGET_FILE=${TARGET_FILE}.bin TARGET_FILE=${TARGET_FILE}.bin
elif [ -f ${TARGET_FILE}.hex ] ; then elif [ -f ${TARGET_FILE}.hex ] ; then
TARGET_FILE=${TARGET_FILE}.hex TARGET_FILE=${TARGET_FILE}.hex
else else
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting"; echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
exit 1 exit 1

47
.travis.yml Normal file → Executable file
View file

@ -1,25 +1,30 @@
env: env:
- RUNTESTS=True # - RUNTESTS=True
- PUBLISHMETA=True # - PUBLISHMETA=True
- TARGET=CC3D - PUBLISHDOCS=True
- TARGET=CC3D OPBL=yes # - TARGET=CC3D
- TARGET=CHEBUZZF3 # - TARGET=CC3D OPBL=yes
- TARGET=CJMCU # - TARGET=CHEBUZZF3
- TARGET=EUSTM32F103RC # - TARGET=CJMCU
- TARGET=SPRACINGF3 # - TARGET=EUSTM32F103RC
- TARGET=NAZE # - TARGET=SPRACINGF3
- TARGET=NAZE32PRO # - TARGET=NAZE
- TARGET=OLIMEXINO # - TARGET=NAZE32PRO
- TARGET=PORT103R # - TARGET=OLIMEXINO
- TARGET=SPARKY # - TARGET=PORT103R
- TARGET=STM32F3DISCOVERY # - TARGET=SPARKY
- TARGET=ALIENWIIF1 # - TARGET=STM32F3DISCOVERY
- TARGET=ALIENWIIF3 # - TARGET=ALIENWIIF1
# - TARGET=ALIENWIIF3
# We use cpp for unit tests, and c for the main project. # We use cpp for unit tests, and c for the main project.
language: cpp language: cpp
compiler: clang compiler: clang
before_install: rvm:
- 1.9.1
before_install:
- sudo apt-get update - 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" - 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 before_script: arm-none-eabi-gcc --version
script: ./.travis.sh script: ./.travis.sh
notifications: #notifications:
irc: "chat.freenode.net#cleanflight" # irc: "chat.freenode.net#cleanflight"
use_notice: true # use_notice: true
skip_join: true # skip_join: true

View file

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

View file

@ -5,8 +5,8 @@ The manual PDF file is generated by concatenating relevant markdown files and by
##Requrements & Installation ##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: 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 ```bash
sudo aptitude install rubygems wkhtmltopdf libxml2-dev libxslt-dev sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems zlib1g-dev wkhtmltopdf libxml2-dev libxslt-dev
sudo gem1.8 install gimli sudo sudo gem1.9.1 install gimli
``` ```
##Configuration ##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 Executable file
View file

@ -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 Normal file → Executable file
View file

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