When I run below command to generate slides from markdown, the theme not selected correctly.
pandoc slides -o slides.html -s -V theme=beige -t revealjs
My slide is in a directory with reveal.js there:
|-- reveal.js
| |-- css
| | |-- reveal.min.css
| | `-- theme
| | |-- beige.css
| |-- js
| | |-- reveal.js
| | `-- reveal.min.js
| `-- lib
| |-- css
| | `-- zenburn.css
| `-- js
| |-- classList.js
`-- slides.md
But it seems it still not use the theme.
Take a look at:
https://gist.github.com/aaronwolen/5017084
The syntax you need is very likely
--variable theme="beige"
For me the solution was to upgrade pandoc from version 1.12 to 1.18
This is the line that I'm using for my transformation:
pandoc -t revealjs -s \
-V theme=beige #specify the theme
-V revealjs-url=https://cdn.jsdelivr.net/reveal.js/3.0.0 \#use a cdn so that I don't need to have it installed
./my_slides.md -o my_slides.html
In order to upgrade pandoc
Download the latest pandoc version from here: https://github.com/jgm/pandoc/releases/latest
Then
sudo aptitude purge pandoc #uninstall current pandoc
sudo dpkg -i <name of the file you just downloaded>
If I remember correctly the syntax is like this:
pandoc slides -o slides.html -s -V theme:beige -t revealjs
(it might even be case-sensitive if you are on *nix)
Related
I'm exploring ways to improve code module integration and have found interest in using named soft links as opposed to include directories, mainly because that allows the integrator to set a directory name of any imported module to something guaranteed not to collide with the module built or any of its imported modules, as well as keeping imported modules from accidently intercepting eachother. However I'm not sure how to actually accomplish this in a makefile.
Here is the directory hierarchy and expected links:
+---proj1
| +---inc
| | head.h
| |
| \---src
| code.c
|
+---proj2
| +---inc
| | head.h
| |
| \---src
| code.c
|
\---proj3
| Makefile
|
\---src
| code.c
| head.h
|
+---A --> ../../proj1/inc
| head.h
|
\---B --> ../../proj2/inc
head.h
In proj3/src/code.c i would have:
#include "head.h"
#include "A/head.h"
#include "B/head.h"
I think I need some way to run ln -s for each {directory,name} tuple prior to compiling the source, putting the link in the same directory as the source being compiled. Parsing INC=dir1 dir2 is simple enough, but how to represent and run ln -s for each pair/tuple in such a list? Or, if having a whole command in each element (ln -s dir1 localname), how to exec all of them?
Other suggestions would be deeply appreciated.
Something like this?
linkdirs := A B
dir_A := ../proj1/src
dir_B := ../proj2/src
.PHONY: all symlinks
all: symlinks hello
symlinks:
$(eval $(patsubst %,ln -fs $$(dir_%) % &&,$(linkdirs)) true
I am writing a short script. One functionality is synchronizing two folders. Now I have two variables with directories to two different folder: DIRECTORY_1 and DIRECTORY_2. In both folders are files and other folders. I need to synchronize these folder to have all files in both folders. For example:
In DIRECTORY_1 I have file1, file2, file3 and folder1
In DIRECTORY_2 I have file4, file5, file6 and folder2
I need comment after which I will have in both directories files1-6 and folders1-2.
I was trying rsync command but it doesn't work properly.
$ mkdir dir1
$ mkdir dir2
$ touch dir1/file1 dir1/file2 dir1/file3
$ mkdir dir1/folder1
$ touch dir2/file4 dir2/file5 dir2/file6
$ mkdir dir2/folder2
$ tree
.
|-- dir1
| |-- file1
| |-- file2
| |-- file3
| `-- folder1
`-- dir2
|-- file4
|-- file5
|-- file6
`-- folder2
$ rsync -a dir1/ dir2
$ tree
.
|-- dir1
| |-- file1
| |-- file2
| |-- file3
| `-- folder1
`-- dir2
|-- file1
|-- file2
|-- file3
|-- file4
|-- file5
|-- file6
|-- folder1
`-- folder2
I guess rsync -d dir2/ dir1 would be next?
Use unison, it's a real folder synchroniser (such as Dropbox or Mega did).
https://www.cis.upenn.edu/~bcpierce/unison/
Mac installation with brew:
brew install unison
I used this command:
unison -auto /path/folder1 /path/folder2
Moreover, and most important to me, if 2 files have the same name, it replaces with the most recent version.
Likely not the most efficient, but this would do the trick:
comm <(ls DIR1) <(ls DIR2) -23 | while read f; do cp -r DIR2/$f DIR1; done
comm <(ls DIR1) <(ls DIR2) -13 | while read f; do cp -r DIR1/$f DIR2; done
I have a DirectX11 project with CMake on Windows.
The project contains (at least) three sub-projects - one is for the core 3D engine library - a common asset directory which contains all the binary data used by the test or sample apps that builds on top of the engine.
./
+-- src/
| +-- api/
| +-- CmakeLists.txt
+-- tests/
| +-- assets/
| | +-- shaders/
| | | +-- 1.hlsl
| | | +-- 2.hlsl
| | | ...
| | +-- images/
| | | ...
| | +-- models/
| | | ...
| | +-- CmakeLists.txt
| +-- sampleApp1/
| | +-- CmakeLists.txt
| | ...
| +-- sampleApp2
| | +-- CmakeLists.txt
| | +-- ...
| | ...
| +-- CmakeLists.txt
+-- CmakeLists.txt
The asset files are just being copied in relative to the test projects binary dir (${CMAKE_CURRENT_BINARY_DIR}) to make them available in relative to their work directory (../assets).
I have hlsl shader files in assets as well. When such files are being added to the project with CMake, VS will treat them as compilable source - obviously - which I wish to avoid, because I want such files to be edited with the IDE and just copy them to the binary folder and use the engine to compile, rather than let VS to do it.
I have tried to set as header file, like another source files that I wish to avoid building, but it seems that something sets them as shader file and overrides this for some reason.
Here is my setup I'm attempting with:
cmake_minimum_required (VERSION 2.6)
project (Project)
subdirs(assets)
In the asset folder I have the following:
file(GLOB_RECURSE FILES *.*)
add_custom_target(assets SOURCES ${FILES})
set_target_properties(assets PROPERTIES FOLDER tests)
# copy static sources
foreach(_source IN ITEMS ${FILES})
# this does not work for some reason
set_source_files_properties(${_source} PROPERTIES HEADER_FILE_ONLY TRUE)
if (IS_ABSOLUTE "${_source}")
file(RELATIVE_PATH _source_rel "${CMAKE_CURRENT_SOURCE_DIR}" "${_source}")
else()
set(source_rel "${_source}")
endif()
get_filename_component(_source_path "${_source_rel}" PATH)
get_filename_component(_source_name "${_source_rel}" NAME)
set(dst_path "${CMAKE_CURRENT_BINARY_DIR}/${_source_path}")
file(MAKE_DIRECTORY ${dst_path})
# -- win32 only
if (WIN32)
string(REPLACE "/" "\\" _source "${_source}")
string(REPLACE "/" "\\" _dest "${dst_path}/${_source_name}")
else()
message("win32 required")
endif(WIN32)
add_custom_command(
TARGET assets
COMMAND copy ${_source} ${_dest}
DEPENDS ${_source}
)
endforeach()
I have tried the following method described in this answer, but didn't succeed.
In CMake HLSL is handled as a source extra, and HEADER_FILE_ONLY doesn't apply here, as you discovered.
You can override this default behaviour by using VS_TOOL_OVERRIDE:
set_source_files_properties(my_shader.hlsl PROPERTIES VS_TOOL_OVERRIDE "None")
See cmVisualStudio10TargetGenerator::WriteExtraSource in CMake source code.
hi i have a requirement like the following
|
|------bar/
|--file.pl
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
i am using the following command.
tar cvzf bar/ x.tar
and the output i am getting is as follows
|
|------bar/
|--file.pl
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
but i want the output like the following.i want to exclude .pl and i want only x.x.x.TXT and .LOG to be tar.
|
|------bar/
|
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
thanks in advance.
$ tar cvzf x.tar bar/ --exclude=*.pl
From man page:
--exclude=PATTERN
exclude files, given as a PATTERN
Try this.
find ./someDir -name "*.log" -o -name "*.TXT" | tar -cf my_archive -T -
I am trying to extract a file from tar using the following command:
tar xzfv mysql-connector-java-5.1.29.tar.gz mysql-connector-java-5.1.29-bin.jar
However tar command is unable to find mysql-connector-java-5.1.29-bin.jar even though it seems to be present. The folder structure which I get when extracting the tar file is:
The jar is present at http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.29.tar.gz.
|-- mysql-connector-java-5.1.29
| |-- CHANGES
| |-- COPYING
| |-- README
| |-- README.txt
| |-- build.xml
| |-- docs
| | |-- README.txt
| | |-- connector-j.html
| | `-- connector-j.pdf
| |-- mysql-connector-java-5.1.29-bin.jar
| `-- src
| |-- com
| | `-- mysql
| | `-- jdbc
I have not included the complete structure for brevity. But it can be seen that mysql-connector-java-5.1.29-bin.jar is present. I am unable to figure out the issue here.
First, try to list the files in the tar.
tar tvf mysql-connector-java-5.1.29.tar.gz
Then you can find that your file is located inside a directory in the tar
mysql-connector-java-5.1.29/mysql-connector-java-5.1.29-bin.jar
So to extract that file, you should use
tar zxvf mysql-connector-java-5.1.29.tar.gz mysql-connector-java-5.1.29/mysql-connector-java-5.1.29-bin.jar