mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
use slate instead of sphinx for documentation
This commit is contained in:
parent
7e391d9ef2
commit
472dd85026
88
docs/CHANGELOG.md
Normal file
88
docs/CHANGELOG.md
Normal file
|
@ -0,0 +1,88 @@
|
|||
# Changelog
|
||||
|
||||
## Version 1.4.0
|
||||
|
||||
*November 24, 2016*
|
||||
|
||||
- Upgrade Middleman and Rouge gems, should hopefully solve a number of bugs
|
||||
- Update some links in README
|
||||
- Fix broken Vagrant startup script
|
||||
- Fix some problems with deploy.sh help message
|
||||
- Fix bug with language tabs not hiding properly if no error
|
||||
- Add `!default` to SASS variables
|
||||
- Fix bug with logo margin
|
||||
- Bump tested Ruby versions in .travis.yml
|
||||
|
||||
## Version 1.3.3
|
||||
|
||||
*June 11, 2016*
|
||||
|
||||
Documentation and example changes.
|
||||
|
||||
## Version 1.3.2
|
||||
|
||||
*February 3, 2016*
|
||||
|
||||
A small bugfix for slightly incorrect background colors on code samples in some cases.
|
||||
|
||||
## Version 1.3.1
|
||||
|
||||
*January 31, 2016*
|
||||
|
||||
A small bugfix for incorrect whitespace in code blocks.
|
||||
|
||||
## Version 1.3
|
||||
|
||||
*January 27, 2016*
|
||||
|
||||
We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs.
|
||||
|
||||
Instead of `rake build` and `rake deploy`, you should now run `bundle exec middleman build --clean` to build your server, and `./deploy.sh` to deploy it to Github Pages.
|
||||
|
||||
## Version 1.2
|
||||
|
||||
*June 20, 2015*
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Remove crash on invalid languages
|
||||
- Update Tocify to scroll to the highlighted header in the Table of Contents
|
||||
- Fix variable leak and update search algorithms
|
||||
- Update Python examples to be valid Python
|
||||
- Update gems
|
||||
- More misc. bugfixes of Javascript errors
|
||||
- Add Dockerfile
|
||||
- Remove unused gems
|
||||
- Optimize images, fonts, and generated asset files
|
||||
- Add chinese font support
|
||||
- Remove RedCarpet header ID patch
|
||||
- Update language tabs to not disturb existing query strings
|
||||
|
||||
## Version 1.1
|
||||
|
||||
*July 27, 2014*
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Finally, a fix for the redcarpet upgrade bug
|
||||
|
||||
## Version 1.0
|
||||
|
||||
*July 2, 2014*
|
||||
|
||||
[View Issues](https://github.com/tripit/slate/issues?milestone=1&state=closed)
|
||||
|
||||
**Features:**
|
||||
|
||||
- Responsive designs for phones and tablets
|
||||
- Started tagging versions
|
||||
|
||||
**Fixes:**
|
||||
|
||||
- Fixed 'unrecognized expression' error
|
||||
- Fixed #undefined hash bug
|
||||
- Fixed bug where the current language tab would be unselected
|
||||
- Fixed bug where tocify wouldn't highlight the current section while searching
|
||||
- Fixed bug where ids of header tags would have special characters that caused problems
|
||||
- Updated layout so that pages with disabled search wouldn't load search.js
|
||||
- Cleaned up Javascript
|
9
docs/Gemfile
Normal file
9
docs/Gemfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
# Middleman
|
||||
gem 'middleman', '~>4.1.0'
|
||||
gem 'middleman-syntax', '~> 3.0.0'
|
||||
gem 'middleman-autoprefixer', '~> 2.7.0'
|
||||
gem "middleman-sprockets", "~> 4.0.0"
|
||||
gem 'rouge', '~> 2.0.5'
|
||||
gem 'redcarpet', '~> 3.3.2'
|
122
docs/Gemfile.lock
Normal file
122
docs/Gemfile.lock
Normal file
|
@ -0,0 +1,122 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.2.7.1)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
autoprefixer-rails (6.4.1)
|
||||
execjs
|
||||
backports (3.6.8)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
concurrent-ruby (1.0.2)
|
||||
contracts (0.13.0)
|
||||
dotenv (2.1.1)
|
||||
erubis (2.7.0)
|
||||
execjs (2.7.0)
|
||||
fast_blank (1.0.0)
|
||||
fastimage (2.0.0)
|
||||
addressable (~> 2)
|
||||
ffi (1.9.14)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
hamster (3.0.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
hashie (3.4.4)
|
||||
i18n (0.7.0)
|
||||
json (1.8.3)
|
||||
kramdown (1.12.0)
|
||||
listen (3.0.8)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
memoist (0.15.0)
|
||||
middleman (4.1.10)
|
||||
coffee-script (~> 2.2)
|
||||
compass-import-once (= 1.0.5)
|
||||
haml (>= 4.0.5)
|
||||
kramdown (~> 1.2)
|
||||
middleman-cli (= 4.1.10)
|
||||
middleman-core (= 4.1.10)
|
||||
sass (>= 3.4.0, < 4.0)
|
||||
middleman-autoprefixer (2.7.0)
|
||||
autoprefixer-rails (>= 6.3.1, < 7.0.0)
|
||||
middleman-core (>= 3.3.3)
|
||||
middleman-cli (4.1.10)
|
||||
thor (>= 0.17.0, < 2.0)
|
||||
middleman-core (4.1.10)
|
||||
activesupport (~> 4.2)
|
||||
addressable (~> 2.3)
|
||||
backports (~> 3.6)
|
||||
bundler (~> 1.1)
|
||||
contracts (~> 0.13.0)
|
||||
dotenv
|
||||
erubis
|
||||
execjs (~> 2.0)
|
||||
fast_blank
|
||||
fastimage (~> 2.0)
|
||||
hamster (~> 3.0)
|
||||
hashie (~> 3.4)
|
||||
i18n (~> 0.7.0)
|
||||
listen (~> 3.0.0)
|
||||
memoist (~> 0.14)
|
||||
padrino-helpers (~> 0.13.0)
|
||||
parallel
|
||||
rack (>= 1.4.5, < 2.0)
|
||||
sass (>= 3.4)
|
||||
servolux
|
||||
tilt (~> 1.4.1)
|
||||
uglifier (~> 3.0)
|
||||
middleman-sprockets (4.0.0)
|
||||
middleman-core (~> 4.0)
|
||||
sprockets (>= 3.0)
|
||||
middleman-syntax (3.0.0)
|
||||
middleman-core (>= 3.2)
|
||||
rouge (~> 2.0)
|
||||
minitest (5.9.0)
|
||||
padrino-helpers (0.13.3.1)
|
||||
i18n (~> 0.6, >= 0.6.7)
|
||||
padrino-support (= 0.13.3.1)
|
||||
tilt (>= 1.4.1, < 3)
|
||||
padrino-support (0.13.3.1)
|
||||
activesupport (>= 3.1)
|
||||
parallel (1.9.0)
|
||||
rack (1.6.4)
|
||||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
redcarpet (3.3.4)
|
||||
rouge (2.0.5)
|
||||
sass (3.4.22)
|
||||
servolux (0.12.0)
|
||||
sprockets (3.7.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (3.0.2)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
middleman (~> 4.1.0)
|
||||
middleman-autoprefixer (~> 2.7.0)
|
||||
middleman-sprockets (~> 4.0.0)
|
||||
middleman-syntax (~> 3.0.0)
|
||||
redcarpet (~> 3.3.2)
|
||||
rouge (~> 2.0.5)
|
||||
|
||||
BUNDLED WITH
|
||||
1.12.5
|
13
docs/LICENSE
Normal file
13
docs/LICENSE
Normal file
|
@ -0,0 +1,13 @@
|
|||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
192
docs/Makefile
192
docs/Makefile
|
@ -1,192 +0,0 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xlnt.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xlnt.qhc"
|
||||
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/xlnt"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xlnt"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
110
docs/README.md
Normal file
110
docs/README.md
Normal file
|
@ -0,0 +1,110 @@
|
|||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
|
||||
<br>
|
||||
<a href="https://travis-ci.org/lord/slate"><img src="https://travis-ci.org/lord/slate.svg?branch=master" alt="Build Status"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
|
||||
|
||||
<p align="center"><img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
|
||||
|
||||
<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://lord.github.io/slate">lord.github.io/slate</a>.</em></p>
|
||||
|
||||
Features
|
||||
------------
|
||||
|
||||
* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
|
||||
|
||||
* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.
|
||||
|
||||
* **Slate is just Markdown** — When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks.
|
||||
|
||||
* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown.
|
||||
|
||||
* **Out-of-the-box syntax highlighting** for [over 100 languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers), no configuration required.
|
||||
|
||||
* **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
|
||||
|
||||
* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere.
|
||||
|
||||
Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://lord.github.io/slate).
|
||||
|
||||
Getting Started with Slate
|
||||
------------------------------
|
||||
|
||||
### Prerequisites
|
||||
|
||||
You're going to need:
|
||||
|
||||
- **Linux or OS X** — Windows may work, but is unsupported.
|
||||
- **Ruby, version 2.2.5 or newer**
|
||||
- **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal.
|
||||
|
||||
### Getting Set Up
|
||||
|
||||
1. Fork this repository on Github.
|
||||
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
|
||||
3. `cd slate`
|
||||
4. Initialize and start Slate. You can either do this locally, or with Vagrant:
|
||||
|
||||
```shell
|
||||
# either run this to run locally
|
||||
bundle install
|
||||
bundle exec middleman server
|
||||
|
||||
# OR run this to run with vagrant
|
||||
vagrant up
|
||||
```
|
||||
|
||||
You can now see the docs at http://localhost:4567. Whoa! That was fast!
|
||||
|
||||
Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/lord/slate/wiki/Deploying-Slate).
|
||||
|
||||
If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/lord/slate/wiki/Docker).
|
||||
|
||||
Companies Using Slate
|
||||
---------------------------------
|
||||
|
||||
* [NASA](https://api.nasa.gov)
|
||||
* [IBM](https://docs.cloudant.com/api.html)
|
||||
* [Sony](http://developers.cimediacloud.com)
|
||||
* [Mozilla](http://mozilla.github.io/localForage/)
|
||||
* [Best Buy](https://bestbuyapis.github.io/api-documentation/)
|
||||
* [Travis-CI](https://docs.travis-ci.com/api/)
|
||||
* [Greenhouse](https://developers.greenhouse.io/harvest.html)
|
||||
* [Woocommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/)
|
||||
* [Appium](http://appium.io/slate/en/master)
|
||||
* [Dwolla](https://docs.dwolla.com/)
|
||||
* [Clearbit](https://clearbit.com/docs)
|
||||
* [Coinbase](https://developers.coinbase.com/api)
|
||||
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
|
||||
* [Fidor Bank](http://docs.fidor.de/)
|
||||
|
||||
You can view more in [the list on the wiki](https://github.com/lord/slate/wiki/Slate-in-the-Wild).
|
||||
|
||||
Need Help? Found a bug?
|
||||
--------------------
|
||||
|
||||
[Submit an issue](https://github.com/lord/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
|
||||
|
||||
Contributors
|
||||
--------------------
|
||||
|
||||
Slate was built by [Robert Lord](https://lord.io) while interning at [TripIt](https://www.tripit.com/).
|
||||
|
||||
Thanks to the following people who have submitted major pull requests:
|
||||
|
||||
- [@chrissrogers](https://github.com/chrissrogers)
|
||||
- [@bootstraponline](https://github.com/bootstraponline)
|
||||
- [@realityking](https://github.com/realityking)
|
||||
- [@cvkef](https://github.com/cvkef)
|
||||
|
||||
Also, thanks to [Sauce Labs](http://saucelabs.com) for helping sponsor the project.
|
||||
|
||||
Special Thanks
|
||||
--------------------
|
||||
- [Middleman](https://github.com/middleman/middleman)
|
||||
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
|
||||
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
|
||||
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
|
||||
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
|
39
docs/Vagrantfile
vendored
Normal file
39
docs/Vagrantfile
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
config.vm.network :forwarded_port, guest: 4567, host: 4567
|
||||
|
||||
config.vm.provision "bootstrap",
|
||||
type: "shell",
|
||||
inline: <<-SHELL
|
||||
sudo apt-get update
|
||||
sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
|
||||
sudo apt-get autoremove -yq
|
||||
gem2.0 install --no-ri --no-rdoc bundler
|
||||
SHELL
|
||||
|
||||
# add the local user git config to the vm
|
||||
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
|
||||
|
||||
config.vm.provision "install",
|
||||
type: "shell",
|
||||
privileged: false,
|
||||
inline: <<-SHELL
|
||||
echo "=============================================="
|
||||
echo "Installing app dependencies"
|
||||
cd /vagrant
|
||||
bundle config build.nokogiri --use-system-libraries
|
||||
bundle install
|
||||
SHELL
|
||||
|
||||
config.vm.provision "run",
|
||||
type: "shell",
|
||||
privileged: false,
|
||||
run: "always",
|
||||
inline: <<-SHELL
|
||||
echo "=============================================="
|
||||
echo "Starting up middleman at http://localhost:4567"
|
||||
echo "If it does not come up, check the ~/middleman.log file for any error messages"
|
||||
cd /vagrant
|
||||
bundle exec middleman server --watcher-force-polling --watcher_latency=1 &> ~/middleman.log &
|
||||
SHELL
|
||||
end
|
|
@ -1,30 +0,0 @@
|
|||
Cell Module
|
||||
===========
|
||||
|
||||
.. doxygenstruct:: xlnt::cell_reference_hash
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::cell_reference
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::cell_type
|
||||
|
||||
.. doxygenclass:: xlnt::cell
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::comment
|
||||
:members:
|
||||
|
||||
.. doxygentypedef:: xlnt::row_t
|
||||
|
||||
.. doxygenclass:: xlnt::column_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::column_hash
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::formatted_text
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::text_run
|
||||
:members:
|
|
@ -1,11 +0,0 @@
|
|||
Packaging Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::manifest
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::relationship
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::uri
|
||||
:members:
|
|
@ -1,11 +0,0 @@
|
|||
Library Modules
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
|
||||
xlnt.cell
|
||||
xlnt.packaging
|
||||
xlnt.styles
|
||||
xlnt.utils
|
||||
xlnt.workbook
|
||||
xlnt.worksheet
|
|
@ -1,37 +0,0 @@
|
|||
Styles Module
|
||||
=============
|
||||
|
||||
.. doxygenclass:: xlnt::alignment
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::border_style
|
||||
|
||||
.. doxygenclass:: xlnt::border
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::color
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::diagonal_direction
|
||||
|
||||
.. doxygenclass:: xlnt::fill
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::font
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::format
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::horizontal_alignment
|
||||
|
||||
.. doxygenclass:: xlnt::number_format
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::protection
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::style
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::vertical_alignment
|
|
@ -1,68 +0,0 @@
|
|||
Utilities Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::exception
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_parameter
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_sheet_title
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::missing_number_format
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_file
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::illegal_character
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_data_type
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_column_string_index
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_cell_reference
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_attribute
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::key_not_found
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::no_visible_worksheets
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::unhandled_switch_case
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::unsupported
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::calendar
|
||||
|
||||
.. doxygenstruct:: xlnt::date
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::datetime
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::time
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::timedelta
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::utf8string
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::optional
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::path
|
||||
:members:
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
Workbook Module
|
||||
===============
|
||||
|
||||
.. doxygenclass:: xlnt::const_worksheet_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::document_security
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::external_book
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::named_range
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::theme
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::workbook
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet_iterator
|
||||
:members:
|
|
@ -1,72 +0,0 @@
|
|||
Worksheet Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::cell_vector
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::cell_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::column_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::const_cell_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::const_range_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::footer
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::header_footer
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::header
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::major_order
|
||||
|
||||
.. doxygenenum:: xlnt::orientation
|
||||
|
||||
.. doxygenenum:: xlnt::page_break
|
||||
|
||||
.. doxygenclass:: xlnt::page_margins
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::page_setup
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::pane
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::paper_size
|
||||
|
||||
.. doxygenclass:: xlnt::range_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::range_reference
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::range
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::row_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::selection
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::sheet_protection
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::sheet_state
|
||||
|
||||
.. doxygenclass:: xlnt::sheet_view
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet
|
||||
:members:
|
|
@ -1,4 +0,0 @@
|
|||
0.9.0 (unreleased)
|
||||
==================
|
||||
|
||||
Beta release
|
|
@ -1,4 +0,0 @@
|
|||
Charts
|
||||
======
|
||||
|
||||
Charts aren't supported yet.
|
|
@ -1,36 +0,0 @@
|
|||
Comments
|
||||
========
|
||||
|
||||
Adding a comment to a cell
|
||||
--------------------------
|
||||
|
||||
Comments have a text attribute and an author attribute, which must both be set.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
xlnt::workbook workbook;
|
||||
auto worksheet = workbook.get_active_sheet();
|
||||
auto comment = worksheet.get_cell("A1").get_comment();
|
||||
comment = xlnt::comment("This is the comment text", "Comment Author");
|
||||
std::cout << comment.get_text() << std::endl;
|
||||
std::cout << comment.get_author() << std::endl;
|
||||
|
||||
You cannot assign the same Comment object to two different cells. Doing so
|
||||
raises an xlnt::attribute_error.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
xlnt::workbook workbook;
|
||||
auto worksheet = workbook.get_active_sheet();
|
||||
xlnt::comment comment("Text", "Author");
|
||||
worksheet.get_cell("A1").set_comment(comment);
|
||||
worksheet.get_cell("B1").set_comment(comment);
|
||||
|
||||
// prints: terminate called after throwing an instance of 'xlnt::attribute_error'
|
||||
|
||||
Loading and saving comments
|
||||
----------------------------
|
||||
|
||||
Comments present in a workbook when loaded are stored in the comment
|
||||
attribute of their respective cells automatically. Comments remaining in a workbook when it is saved are automatically saved to
|
||||
the workbook file.
|
300
docs/conf.py
300
docs/conf.py
|
@ -1,300 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# xlnt documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Oct 26 10:31:07 2015.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import shlex
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
if on_rtd:
|
||||
from subprocess import call
|
||||
call('doxygen Doxyfile', shell=True)
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.viewcode',
|
||||
'breathe'
|
||||
]
|
||||
|
||||
# Breathe extension variables
|
||||
breathe_projects = { "xlnt" : "doxyxml/" }
|
||||
breathe_default_project = "xlnt"
|
||||
breathe_doxygen_config_options = {'EXCLUDE_SYMBOLS': 'XLNT_API'}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'xlnt'
|
||||
copyright = '2015, Thomas Fussell'
|
||||
author = 'Thomas Fussell'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.9'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.9'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'xlntdoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'xlnt.tex', 'xlnt Documentation',
|
||||
'Thomas Fussell', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'xlnt', 'xlnt Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'xlnt', 'xlnt Documentation',
|
||||
author, 'xlnt', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
46
docs/config.rb
Normal file
46
docs/config.rb
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Markdown
|
||||
set :markdown_engine, :redcarpet
|
||||
set :markdown,
|
||||
fenced_code_blocks: true,
|
||||
smartypants: true,
|
||||
disable_indented_code_blocks: true,
|
||||
prettify: true,
|
||||
tables: true,
|
||||
with_toc_data: true,
|
||||
no_intra_emphasis: true
|
||||
|
||||
# Assets
|
||||
set :css_dir, 'stylesheets'
|
||||
set :js_dir, 'javascripts'
|
||||
set :images_dir, 'images'
|
||||
set :fonts_dir, 'fonts'
|
||||
|
||||
# Activate the syntax highlighter
|
||||
activate :syntax
|
||||
|
||||
activate :sprockets
|
||||
|
||||
activate :autoprefixer do |config|
|
||||
config.browsers = ['last 2 version', 'Firefox ESR']
|
||||
config.cascade = false
|
||||
config.inline = true
|
||||
end
|
||||
|
||||
# Github pages require relative links
|
||||
activate :relative_assets
|
||||
set :relative_links, true
|
||||
|
||||
# Build Configuration
|
||||
configure :build do
|
||||
# If you're having trouble with Middleman hanging, commenting
|
||||
# out the following two lines has been known to help
|
||||
activate :minify_css
|
||||
activate :minify_javascript
|
||||
# activate :relative_assets
|
||||
# activate :asset_hash
|
||||
# activate :gzip
|
||||
end
|
||||
|
||||
# Deploy Configuration
|
||||
# If you want Middleman to listen on a different port, you can set that below
|
||||
set :port, 4567
|
|
@ -1,204 +0,0 @@
|
|||
Simple usage
|
||||
============
|
||||
|
||||
Write a workbook
|
||||
----------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
|
||||
std::string dest_filename = "empty_book.xlsx";
|
||||
|
||||
auto ws1 = wb.get_active_sheet();
|
||||
ws1.set_title("range names");
|
||||
|
||||
for(xlnt::row_t row = 1; row < 40; row++)
|
||||
{
|
||||
std::vector<int> to_append(600, 0);
|
||||
std::iota(std::begin(to_append), std::end(to_append), 0);
|
||||
ws1.append(to_append);
|
||||
}
|
||||
|
||||
auto ws2 = wb.create_sheet("Pi");
|
||||
|
||||
ws2.get_cell("F5").set_value(3.14);
|
||||
|
||||
for(xlnt::row_t row = 10; row < 20; row++)
|
||||
{
|
||||
for(xlnt::column_t column = 27; column < 54; column++)
|
||||
{
|
||||
ws3.get_cell(column, row).set_value(column.column_string());
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << ws3.get_cell("AA10") << std::endl;
|
||||
|
||||
wb.save(dest_filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Read an existing workbook
|
||||
-------------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load("empty_book.xlsx");
|
||||
auto sheet_ranges = wb.get_range("range names");
|
||||
|
||||
std::cout << sheet_ranges["D18"] << std::endl;
|
||||
// prints: 3
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
.. note ::
|
||||
|
||||
There are several optional parameters that can be used in xlnt::workbook::load (in order):
|
||||
|
||||
- `guess_types` will enable or disable (default) type inference when
|
||||
reading cells.
|
||||
|
||||
- `data_only` controls whether cells with formulae have either the
|
||||
formula (default) or the value stored the last time Excel read the sheet.
|
||||
|
||||
- `keep_vba` controls whether any Visual Basic elements are preserved or
|
||||
not (default). If they are preserved they are still not editable.
|
||||
|
||||
|
||||
.. warning ::
|
||||
|
||||
xlnt does currently not read all possible items in an Excel file so
|
||||
images and charts will be lost from existing files if they are opened and
|
||||
saved with the same name.
|
||||
|
||||
|
||||
Using number formats
|
||||
--------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.guess_types(true);
|
||||
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_value(xlnt::datetime(2010, 7, 21));
|
||||
std::cout << ws.get_cell("A1").get_number_format().get_format_string() << std::endl
|
||||
// prints: yyyy-mm-dd h:mm:ss
|
||||
|
||||
// set percentage using a string followed by the percent sign
|
||||
ws.get_cell("B1").set_value("3.14%");
|
||||
std::cout << cell.get_value<long double>() << std::endl;
|
||||
// prints: 0.031400000000000004
|
||||
std::cout << cell << std::endl;
|
||||
// prints: 3.14%
|
||||
std::cout << cell.get_number_format().get_format_string() << std::endl;
|
||||
// prints: 0%
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Using formulae
|
||||
--------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_formula("=SUM(1, 1)");
|
||||
wb.save("formula.xlsx");
|
||||
}
|
||||
|
||||
.. warning::
|
||||
NB you must use the English name for a function and function arguments *must* be separated by commas and not other punctuation such as semi-colons.
|
||||
|
||||
xlsx never evaluates formula but it is possible to check the name of a formula:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
bool found = xlnt::formulae::exists("HEX2DEC");
|
||||
std::cout << (found ? "True" : "False") << std::endl;
|
||||
// prints: True
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
If you're trying to use a formula that isn't known this could be because you're using a formula that was not included in the initial specification. Such formulae must be prefixed with `xlfn.` to work.
|
||||
|
||||
Merge / Unmerge cells
|
||||
---------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
|
||||
ws.merge_cells("A1:B1");
|
||||
ws.unmerge_cells("A1:B1");
|
||||
|
||||
// or
|
||||
|
||||
ws.merge_cells(1, 2, 4, 2)
|
||||
ws.unmerge_cells(1, 2, 4, 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Inserting an image
|
||||
-------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_value("You should see three logos below");
|
||||
|
||||
// create an image
|
||||
auto img = xlnt::image("logo.png");
|
||||
|
||||
// add to worksheet and anchor next to cells
|
||||
ws.add_image(img, "A1");
|
||||
wb.save("logo.xlsx");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Fold columns (outline)
|
||||
----------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.create_sheet();
|
||||
bool hidden = true;
|
||||
ws.group_columns("A", "D", hidden);
|
||||
wb.save("group.xlsx");
|
||||
|
||||
return 0;
|
||||
}
|
203
docs/deploy.sh
Executable file
203
docs/deploy.sh
Executable file
|
@ -0,0 +1,203 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o errexit #abort if any command fails
|
||||
me=$(basename "$0")
|
||||
|
||||
help_message="\
|
||||
Usage: $me [-c FILE] [<options>]
|
||||
Deploy generated files to a git branch.
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help Show this help information.
|
||||
-v, --verbose Increase verbosity. Useful for debugging.
|
||||
-e, --allow-empty Allow deployment of an empty directory.
|
||||
-m, --message MESSAGE Specify the message used when committing on the
|
||||
deploy branch.
|
||||
-n, --no-hash Don't append the source commit's hash to the deploy
|
||||
commit's message.
|
||||
"
|
||||
|
||||
bundle exec middleman build --clean
|
||||
|
||||
parse_args() {
|
||||
# Set args from a local environment file.
|
||||
if [ -e ".env" ]; then
|
||||
source .env
|
||||
fi
|
||||
|
||||
# Parse arg flags
|
||||
# If something is exposed as an environment variable, set/overwrite it
|
||||
# here. Otherwise, set/overwrite the internal variable instead.
|
||||
while : ; do
|
||||
if [[ $1 = "-h" || $1 = "--help" ]]; then
|
||||
echo "$help_message"
|
||||
return 0
|
||||
elif [[ $1 = "-v" || $1 = "--verbose" ]]; then
|
||||
verbose=true
|
||||
shift
|
||||
elif [[ $1 = "-e" || $1 = "--allow-empty" ]]; then
|
||||
allow_empty=true
|
||||
shift
|
||||
elif [[ ( $1 = "-m" || $1 = "--message" ) && -n $2 ]]; then
|
||||
commit_message=$2
|
||||
shift 2
|
||||
elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then
|
||||
GIT_DEPLOY_APPEND_HASH=false
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Set internal option vars from the environment and arg flags. All internal
|
||||
# vars should be declared here, with sane defaults if applicable.
|
||||
|
||||
# Source directory & target branch.
|
||||
deploy_directory=build
|
||||
deploy_branch=gh-pages
|
||||
|
||||
#if no user identity is already set in the current git environment, use this:
|
||||
default_username=${GIT_DEPLOY_USERNAME:-deploy.sh}
|
||||
default_email=${GIT_DEPLOY_EMAIL:-}
|
||||
|
||||
#repository to deploy to. must be readable and writable.
|
||||
repo=origin
|
||||
|
||||
#append commit hash to the end of message by default
|
||||
append_hash=${GIT_DEPLOY_APPEND_HASH:-true}
|
||||
}
|
||||
|
||||
main() {
|
||||
parse_args "$@"
|
||||
|
||||
enable_expanded_output
|
||||
|
||||
if ! git diff --exit-code --quiet --cached; then
|
||||
echo Aborting due to uncommitted changes in the index >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
commit_title=`git log -n 1 --format="%s" HEAD`
|
||||
commit_hash=` git log -n 1 --format="%H" HEAD`
|
||||
|
||||
#default commit message uses last title if a custom one is not supplied
|
||||
if [[ -z $commit_message ]]; then
|
||||
commit_message="publish: $commit_title"
|
||||
fi
|
||||
|
||||
#append hash to commit message unless no hash flag was found
|
||||
if [ $append_hash = true ]; then
|
||||
commit_message="$commit_message"$'\n\n'"generated from commit $commit_hash"
|
||||
fi
|
||||
|
||||
previous_branch=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
if [ ! -d "$deploy_directory" ]; then
|
||||
echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# must use short form of flag in ls for compatibility with OS X and BSD
|
||||
if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
|
||||
echo "Deploy directory '$deploy_directory' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then
|
||||
# deploy_branch exists in $repo; make sure we have the latest version
|
||||
|
||||
disable_expanded_output
|
||||
git fetch --force $repo $deploy_branch:$deploy_branch
|
||||
enable_expanded_output
|
||||
fi
|
||||
|
||||
# check if deploy_branch exists locally
|
||||
if git show-ref --verify --quiet "refs/heads/$deploy_branch"
|
||||
then incremental_deploy
|
||||
else initial_deploy
|
||||
fi
|
||||
|
||||
restore_head
|
||||
}
|
||||
|
||||
initial_deploy() {
|
||||
git --work-tree "$deploy_directory" checkout --orphan $deploy_branch
|
||||
git --work-tree "$deploy_directory" add --all
|
||||
commit+push
|
||||
}
|
||||
|
||||
incremental_deploy() {
|
||||
#make deploy_branch the current branch
|
||||
git symbolic-ref HEAD refs/heads/$deploy_branch
|
||||
#put the previously committed contents of deploy_branch into the index
|
||||
git --work-tree "$deploy_directory" reset --mixed --quiet
|
||||
git --work-tree "$deploy_directory" add --all
|
||||
|
||||
set +o errexit
|
||||
diff=$(git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD --)$?
|
||||
set -o errexit
|
||||
case $diff in
|
||||
0) echo No changes to files in $deploy_directory. Skipping commit.;;
|
||||
1) commit+push;;
|
||||
*)
|
||||
echo git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to master, use: git symbolic-ref HEAD refs/heads/master && git reset --mixed >&2
|
||||
return $diff
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
commit+push() {
|
||||
set_user_id
|
||||
git --work-tree "$deploy_directory" commit -m "$commit_message"
|
||||
|
||||
disable_expanded_output
|
||||
#--quiet is important here to avoid outputting the repo URL, which may contain a secret token
|
||||
git push --quiet $repo $deploy_branch
|
||||
enable_expanded_output
|
||||
}
|
||||
|
||||
#echo expanded commands as they are executed (for debugging)
|
||||
enable_expanded_output() {
|
||||
if [ $verbose ]; then
|
||||
set -o xtrace
|
||||
set +o verbose
|
||||
fi
|
||||
}
|
||||
|
||||
#this is used to avoid outputting the repo URL, which may contain a secret token
|
||||
disable_expanded_output() {
|
||||
if [ $verbose ]; then
|
||||
set +o xtrace
|
||||
set -o verbose
|
||||
fi
|
||||
}
|
||||
|
||||
set_user_id() {
|
||||
if [[ -z `git config user.name` ]]; then
|
||||
git config user.name "$default_username"
|
||||
fi
|
||||
if [[ -z `git config user.email` ]]; then
|
||||
git config user.email "$default_email"
|
||||
fi
|
||||
}
|
||||
|
||||
restore_head() {
|
||||
if [[ $previous_branch = "HEAD" ]]; then
|
||||
#we weren't on any branch before, so just set HEAD back to the commit it was on
|
||||
git update-ref --no-deref HEAD $commit_hash $deploy_branch
|
||||
else
|
||||
git symbolic-ref HEAD refs/heads/$previous_branch
|
||||
fi
|
||||
|
||||
git reset --mixed
|
||||
}
|
||||
|
||||
filter() {
|
||||
sed -e "s|$repo|\$repo|g"
|
||||
}
|
||||
|
||||
sanitize() {
|
||||
"$@" 2> >(filter 1>&2) | filter
|
||||
}
|
||||
|
||||
[[ $1 = --source-only ]] || main "$@"
|
|
@ -1,50 +0,0 @@
|
|||
Development
|
||||
===========
|
||||
|
||||
What is suppoprted
|
||||
------------------
|
||||
|
||||
Supporting different platforms
|
||||
------------------------------
|
||||
|
||||
Coding style
|
||||
------------
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
Coverage
|
||||
++++++++
|
||||
|
||||
Organisation
|
||||
++++++++++++
|
||||
|
||||
Checking XML
|
||||
++++++++++++
|
||||
|
||||
Schema validation
|
||||
+++++++++++++++++
|
||||
|
||||
Microsoft Tools
|
||||
+++++++++++++++
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Contributions in the form of pull requests are always welcome. Don't forget
|
||||
to add yourself to the list of authors!
|
||||
|
||||
Branch naming convention
|
||||
------------------------
|
||||
|
||||
Pull Requests
|
||||
-------------
|
||||
|
||||
Documentation
|
||||
+++++++++++++
|
||||
|
||||
Benchmarking
|
||||
------------
|
||||
|
||||
Memory Use
|
||||
++++++++++
|
148
docs/font-selection.json
Executable file
148
docs/font-selection.json
Executable file
|
@ -0,0 +1,148 @@
|
|||
{
|
||||
"IcoMoonType": "selection",
|
||||
"icons": [
|
||||
{
|
||||
"icon": {
|
||||
"paths": [
|
||||
"M438.857 73.143q119.429 0 220.286 58.857t159.714 159.714 58.857 220.286-58.857 220.286-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857zM512 785.714v-108.571q0-8-5.143-13.429t-12.571-5.429h-109.714q-7.429 0-13.143 5.714t-5.714 13.143v108.571q0 7.429 5.714 13.143t13.143 5.714h109.714q7.429 0 12.571-5.429t5.143-13.429zM510.857 589.143l10.286-354.857q0-6.857-5.714-10.286-5.714-4.571-13.714-4.571h-125.714q-8 0-13.714 4.571-5.714 3.429-5.714 10.286l9.714 354.857q0 5.714 5.714 10t13.714 4.286h105.714q8 0 13.429-4.286t6-10z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"tags": [
|
||||
"exclamation-circle"
|
||||
],
|
||||
"defaultCode": 61546,
|
||||
"grid": 14
|
||||
},
|
||||
"attrs": [],
|
||||
"properties": {
|
||||
"id": 100,
|
||||
"order": 4,
|
||||
"prevSize": 28,
|
||||
"code": 58880,
|
||||
"name": "exclamation-sign",
|
||||
"ligatures": ""
|
||||
},
|
||||
"setIdx": 0,
|
||||
"iconIdx": 0
|
||||
},
|
||||
{
|
||||
"icon": {
|
||||
"paths": [
|
||||
"M585.143 786.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-54.857v-292.571q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h54.857v182.857h-54.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h256q8 0 13.143-5.143t5.143-13.143zM512 274.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-109.714q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h109.714q8 0 13.143-5.143t5.143-13.143zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"tags": [
|
||||
"info-circle"
|
||||
],
|
||||
"defaultCode": 61530,
|
||||
"grid": 14
|
||||
},
|
||||
"attrs": [],
|
||||
"properties": {
|
||||
"id": 85,
|
||||
"order": 3,
|
||||
"name": "info-sign",
|
||||
"prevSize": 28,
|
||||
"code": 58882
|
||||
},
|
||||
"setIdx": 0,
|
||||
"iconIdx": 2
|
||||
},
|
||||
{
|
||||
"icon": {
|
||||
"paths": [
|
||||
"M733.714 419.429q0-16-10.286-26.286l-52-51.429q-10.857-10.857-25.714-10.857t-25.714 10.857l-233.143 232.571-129.143-129.143q-10.857-10.857-25.714-10.857t-25.714 10.857l-52 51.429q-10.286 10.286-10.286 26.286 0 15.429 10.286 25.714l206.857 206.857q10.857 10.857 25.714 10.857 15.429 0 26.286-10.857l310.286-310.286q10.286-10.286 10.286-25.714zM877.714 512q0 119.429-58.857 220.286t-159.714 159.714-220.286 58.857-220.286-58.857-159.714-159.714-58.857-220.286 58.857-220.286 159.714-159.714 220.286-58.857 220.286 58.857 159.714 159.714 58.857 220.286z"
|
||||
],
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"tags": [
|
||||
"check-circle"
|
||||
],
|
||||
"defaultCode": 61528,
|
||||
"grid": 14
|
||||
},
|
||||
"attrs": [],
|
||||
"properties": {
|
||||
"id": 83,
|
||||
"order": 9,
|
||||
"prevSize": 28,
|
||||
"code": 58886,
|
||||
"name": "ok-sign"
|
||||
},
|
||||
"setIdx": 0,
|
||||
"iconIdx": 6
|
||||
},
|
||||
{
|
||||
"icon": {
|
||||
"paths": [
|
||||
"M658.286 475.429q0-105.714-75.143-180.857t-180.857-75.143-180.857 75.143-75.143 180.857 75.143 180.857 180.857 75.143 180.857-75.143 75.143-180.857zM950.857 950.857q0 29.714-21.714 51.429t-51.429 21.714q-30.857 0-51.429-21.714l-196-195.429q-102.286 70.857-228 70.857-81.714 0-156.286-31.714t-128.571-85.714-85.714-128.571-31.714-156.286 31.714-156.286 85.714-128.571 128.571-85.714 156.286-31.714 156.286 31.714 128.571 85.714 85.714 128.571 31.714 156.286q0 125.714-70.857 228l196 196q21.143 21.143 21.143 51.429z"
|
||||
],
|
||||
"width": 951,
|
||||
"attrs": [],
|
||||
"isMulticolor": false,
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"defaultCode": 61442,
|
||||
"grid": 14
|
||||
},
|
||||
"attrs": [],
|
||||
"properties": {
|
||||
"id": 2,
|
||||
"order": 1,
|
||||
"prevSize": 28,
|
||||
"code": 58887,
|
||||
"name": "icon-search"
|
||||
},
|
||||
"setIdx": 0,
|
||||
"iconIdx": 7
|
||||
}
|
||||
],
|
||||
"height": 1024,
|
||||
"metadata": {
|
||||
"name": "slate",
|
||||
"license": "SIL OFL 1.1"
|
||||
},
|
||||
"preferences": {
|
||||
"showGlyphs": true,
|
||||
"showQuickUse": true,
|
||||
"showQuickUse2": true,
|
||||
"showSVGs": true,
|
||||
"fontPref": {
|
||||
"prefix": "icon-",
|
||||
"metadata": {
|
||||
"fontFamily": "slate",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0,
|
||||
"description": "Based on FontAwesome",
|
||||
"license": "SIL OFL 1.1"
|
||||
},
|
||||
"metrics": {
|
||||
"emSize": 1024,
|
||||
"baseline": 6.25,
|
||||
"whitespace": 50
|
||||
},
|
||||
"resetPoint": 58880,
|
||||
"showSelector": false,
|
||||
"selector": "class",
|
||||
"classSelector": ".icon",
|
||||
"showMetrics": false,
|
||||
"showMetadata": true,
|
||||
"showVersion": true,
|
||||
"ie7": false
|
||||
},
|
||||
"imagePref": {
|
||||
"prefix": "icon-",
|
||||
"png": true,
|
||||
"useClassSelector": true,
|
||||
"color": 4473924,
|
||||
"bgColor": 16777215
|
||||
},
|
||||
"historySize": 100,
|
||||
"showCodes": true,
|
||||
"gridSize": 16,
|
||||
"showLiga": false
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
Conditional Formatting
|
||||
======================
|
||||
|
||||
Not supported yet.
|
106
docs/formula.rst
106
docs/formula.rst
|
@ -1,106 +0,0 @@
|
|||
Parsing Formulas
|
||||
================
|
||||
|
||||
`xlnt` supports limited parsing of formulas embedded in cells. The
|
||||
`xlnt/formula` module contains a `tokenizer` class to break
|
||||
formulas into their consitutuent tokens. Usage is as follows:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string formula = R"(=IF($A$1,"then True",MAX(DEFAULT_VAL,'Sheet 2'!B1)))";
|
||||
xlnt::tokenizer tok(formula);
|
||||
tok.parse();
|
||||
|
||||
for(auto &t : tok.get_items())
|
||||
{
|
||||
std::cout << t.get_value() << "\t" << t.get_type() << "\t" << t.get_subtype() << std::endl;
|
||||
}
|
||||
|
||||
// prints:
|
||||
//
|
||||
// IF( FUNC OPEN
|
||||
// $A$1 OPERAND RANGE
|
||||
// , SEP ARG
|
||||
// "then True" OPERAND TEXT
|
||||
// , SEP ARG
|
||||
// MAX( FUNC OPEN
|
||||
// DEFAULT_VAL OPERAND RANGE
|
||||
// , SEP ARG
|
||||
// 'Sheet 2'!B1 OPERAND RANGE
|
||||
// ) FUNC CLOSE
|
||||
// ) FUNC CLOSE
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
As shown above, tokens have three attributes of interest:
|
||||
|
||||
* ``.value``: The substring of the formula that produced this token
|
||||
|
||||
* ``.type``: The type of token this represents. Can be one of
|
||||
|
||||
- ``token::literal``: If the cell does not contain a formula, its
|
||||
value is represented by a single ``LITERAL`` token.
|
||||
|
||||
- ``token::operand``: A generic term for any value in the Excel
|
||||
formula. (See ``.subtype`` below for more details).
|
||||
|
||||
- ``token::func``: Function calls are broken up into tokens for the
|
||||
opener (e.g., ``SUM(``), followed by the arguments, followed by
|
||||
the closer (i.e., ``)``). The function name and opening
|
||||
parenthesis together form one ``FUNC`` token, and the matching
|
||||
parenthesis forms another ``FUNC`` token.
|
||||
|
||||
- ``token::array``: Array literals (enclosed between curly braces)
|
||||
get two ``ARRAY`` tokens each, one for the opening ``{`` and one
|
||||
for the closing ``}``.
|
||||
|
||||
- ``token::paren``: When used for grouping subexpressions (and not to
|
||||
denote function calls), parentheses are tokenized as ``paren``
|
||||
tokens (one per character).
|
||||
|
||||
- ``token::sep``: These tokens are created from either commas (``,``)
|
||||
or semicolons (``;``). Commas create ``sep`` tokens when they are
|
||||
used to separate function arguments (e.g., ``SUM(a,b)``) or when
|
||||
they are used to separate array elements (e.g., ``{a,b}``). (They
|
||||
have another use as an infix operator for joining
|
||||
ranges). Semicolons are always used to separate rows in an array
|
||||
literal, so always create ``sep`` tokens.
|
||||
|
||||
- ``token::op_pre``: Designates a prefix unary operator. Its value is
|
||||
always ``+`` or ``-``
|
||||
|
||||
- ``token::op_in``: Designates an infix binary operator. Possible
|
||||
values are ``>=``, ``<=``, ``<>``, ``=``, ``>``, ``<``, ``*``,
|
||||
``/``, ``+``, ``-``, ``^``, or ``&``.
|
||||
|
||||
- ``token::op_post``: Designates a postfix unary operator. Its value
|
||||
is always ``%``.
|
||||
|
||||
- ``token::wspace``: Created for any whitespace encountered. Its
|
||||
value is always a single space, regardless of how much whitespace
|
||||
is found.
|
||||
|
||||
* ``.subtype``: Some of the token types above use the subtype to
|
||||
provide additional information about the token. Possible subtypes
|
||||
are:
|
||||
|
||||
+ ``token::text``, ``token::number``, ``token::logical``,
|
||||
``token::error``, ``token::range``: these subtypes describe the
|
||||
various forms of ``operand`` found in formulae. ``logical`` is
|
||||
either ``true`` or ``false``, ``range`` is either a named range or
|
||||
a direct reference to another range. ``text``, ``number``, and
|
||||
``error`` all refer to literal values in the formula
|
||||
|
||||
+ ``token::open`` and ``token::close``: these two subtypes are used by
|
||||
``paren``, ``func``, and ``array``, to describe whether the token
|
||||
is opening a new subexpression or closing it.
|
||||
|
||||
+ ``token::arg`` and ``token::row``: are used by the ``sep`` tokens,
|
||||
to distinguish between the comma and semicolon. Commas produce
|
||||
tokens of subtype ``arg`` whereas semicolons produce tokens of
|
||||
subtype ``row``
|
100
docs/generate-md.js
Normal file
100
docs/generate-md.js
Normal file
|
@ -0,0 +1,100 @@
|
|||
var xpath = require('xpath');
|
||||
var dom = require('xmldom').DOMParser;
|
||||
var fs = require('fs');
|
||||
var _ = require('underscore');
|
||||
var async = require('async');
|
||||
|
||||
function generate(directory, primary_callback) {
|
||||
var modules = [];
|
||||
return fs.readFile(directory + 'index.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygenindex/compound[@kind="dir"]', doc);
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.firstChild.toString();
|
||||
modules.push({name: name, refid: refid});
|
||||
}
|
||||
const root_module = _.find(modules, (module) => {
|
||||
return _.last(module.name.split('/')) == 'xlnt';
|
||||
});
|
||||
const root_name = root_module.name;
|
||||
modules = _.filter(modules, (module) => {
|
||||
return module.name.indexOf(root_name) >= 0 && module.name !== root_name;
|
||||
});
|
||||
return async.mapSeries(modules, (module, module_callback) => {
|
||||
return fs.readFile(directory + module.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/innerfile', doc);
|
||||
module.source_files = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.toString();
|
||||
module.source_files.push({name: name, refid: refid});
|
||||
}
|
||||
return async.map(module.source_files, (source_file, source_file_callback) => {
|
||||
return fs.readFile(directory + source_file.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/innerclass', doc);
|
||||
module.class_files = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.toString();
|
||||
module.class_files.push({name: name, refid: refid});
|
||||
}
|
||||
return async.map(module.class_files, (class_file, class_file_callback) => {
|
||||
return fs.readFile(directory + class_file.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/sectiondef/memberdef[@prot="public"]', doc);
|
||||
var members = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var member_data = {id: nodes[i].getAttribute('id')};
|
||||
var child = nodes[i].firstChild;
|
||||
while (child != nodes[i].lastChild) {
|
||||
if (child.textContent.trim()) {
|
||||
member_data[child.nodeName] = child.textContent.trim();
|
||||
}
|
||||
child = child.nextSibling;
|
||||
}
|
||||
members.push(member_data);
|
||||
}
|
||||
class_file.members = members;
|
||||
return class_file_callback(null, class_file);
|
||||
});
|
||||
}, (err, data) => {
|
||||
return source_file_callback(null, _.flatten(data, true));
|
||||
});
|
||||
});
|
||||
}, (err, data) => {
|
||||
module.classes = _.flatten(data, true);
|
||||
return module_callback(null, module);
|
||||
});
|
||||
});
|
||||
}, (err, data) => {
|
||||
return primary_callback(null, _.flatten(data, true));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
generate('doxyxml/', function(err, data) {
|
||||
console.log('# API Reference');
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var module = data[i];
|
||||
var module_name = _.last(module.name.split('/'));
|
||||
console.log('##', module_name.charAt(0).toUpperCase() + module_name.slice(1), 'Module');
|
||||
for (var j = 0; j < module.classes.length; j++) {
|
||||
var class_ = module.classes[j];
|
||||
console.log('###', _.last(class_.name.split('::')));
|
||||
for (var k = 0; k < class_.members.length; k++) {
|
||||
var member = class_.members[k];
|
||||
console.log('####', '```' + member.definition + '```');
|
||||
if (member.briefdescription) {
|
||||
console.log(member.briefdescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
232
docs/index.rst
232
docs/index.rst
|
@ -1,232 +0,0 @@
|
|||
:mod:`xlnt` - user-friendly xlsx library for C++14
|
||||
===========================================================================
|
||||
|
||||
.. module:: xlnt
|
||||
.. moduleauthor:: Thomas Fussell
|
||||
|
||||
:Author: Thomas Fussell
|
||||
:Source code: https://github.com/tfussell/xlnt
|
||||
:Issues: https://github.com/tfussell/xlnt/issues
|
||||
:Generated: |today|
|
||||
:License: MIT
|
||||
:Version: |release|
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
xlnt is a C++14 library for reading, writing, and modifying XLSX files as described in [ECMA 376](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The API is based on [openpyxl](https://bitbucket.org/openpyxl/openpyxl), a Python library to read/write Excel 2007 xlsx/xlsm files, and ultimately on [PHPExcel](https://github.com/PHPOffice/PHPExcel), pure PHP library for reading and writing spreadsheet files upon which openpyxl was based. This project is still very much a work in progress, but the core development work is complete.
|
||||
|
||||
Summary of Features
|
||||
+++++++++++++++++++
|
||||
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Feature | Read | Edit | Write |
|
||||
+=====================================================================+======+======+=======+
|
||||
| Excel-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| LibreOffice-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Numbers-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Encrypted Workbook (Excel 2007-2010) | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Encrypted Workbook (Excel 2013-2016) | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Binary Workbook (.xlsb) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Macro-Enabled Workbook (.xlsm) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Macro-Enabled Template (.xltm) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Document Properties | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Numeric Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Inline String Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Shared String Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Shared String Text Run Formatting (e.g. varied fonts within a cell) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Hyperlink Cell Values | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formula Cell Values | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formula Evaluation | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Page Margins | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Page Setup | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Print Area | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Comments | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Header and Footer | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom Views | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Charts | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Chartsheets | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Dialogsheets | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Themes | ✓ | | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Cell Styles | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Cell Formats | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Alignment (e.g. right align) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Border (e.g. red cell outline) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Fill (e.g. green cell background) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Font (e.g. blue cell text) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Number Format (e.g. show 2 decimals) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Protection (e.g. hide formulas) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Column Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Row Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Sheet Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Conditional Formatting | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Tables | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Table Formatting | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Pivot Tables | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| XLSX Thumbnail | ✓ | | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom OOXML Properties | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom OOXML Parts | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Drawing | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Text Box | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| WordArt | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Embedded Content (e.g. images) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel VBA | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
|
||||
Sample code:
|
||||
++++++++++++
|
||||
|
||||
.. literalinclude:: ../samples/sample.cpp
|
||||
|
||||
|
||||
How to Contribute Code
|
||||
----------------------
|
||||
|
||||
See `Information For Developers`_
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Getting the source
|
||||
------------------
|
||||
|
||||
Usage examples
|
||||
--------------
|
||||
|
||||
Tutorial
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
tutorial
|
||||
|
||||
Cookbook
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
cookbook
|
||||
|
||||
Charts
|
||||
++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
charts/introduction
|
||||
|
||||
Comments
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
comments
|
||||
|
||||
Working with styles
|
||||
+++++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
styles
|
||||
|
||||
Conditional Formatting
|
||||
++++++++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
formatting
|
||||
|
||||
Data Validation
|
||||
+++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
validation
|
||||
|
||||
Parsing Formulas
|
||||
++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
formula
|
||||
|
||||
|
||||
Information for Developers
|
||||
--------------------------
|
||||
|
||||
.. toctree::
|
||||
|
||||
development
|
||||
windows-development
|
||||
|
||||
API Documentation
|
||||
------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
api/xlnt
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
changes
|
263
docs/make.bat
263
docs/make.bat
|
@ -1,263 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. xml to make Docutils-native XML files
|
||||
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
echo. coverage to run coverage check of the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
REM Check if sphinx-build is available and fallback to Python version if any
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 goto sphinx_python
|
||||
goto sphinx_ok
|
||||
|
||||
:sphinx_python
|
||||
|
||||
set SPHINXBUILD=python -m sphinx.__init__
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:sphinx_ok
|
||||
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\xlnt.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xlnt.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdf" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdfja" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf-ja
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "coverage" (
|
||||
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of coverage in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/coverage/python.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "xml" (
|
||||
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pseudoxml" (
|
||||
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
|
@ -1 +0,0 @@
|
|||
breathe
|
BIN
docs/source/fonts/slate.eot
Executable file
BIN
docs/source/fonts/slate.eot
Executable file
Binary file not shown.
14
docs/source/fonts/slate.svg
Executable file
14
docs/source/fonts/slate.svg
Executable file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="slate" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="512" />
|
||||
<glyph unicode="" d="M438.857 877.714q119.429 0 220.286-58.857t159.714-159.714 58.857-220.286-58.857-220.286-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857zM512 165.143v108.571q0 8-5.143 13.429t-12.571 5.429h-109.714q-7.429 0-13.143-5.714t-5.714-13.143v-108.571q0-7.429 5.714-13.143t13.143-5.714h109.714q7.429 0 12.571 5.429t5.143 13.429zM510.857 361.714l10.286 354.857q0 6.857-5.714 10.286-5.714 4.571-13.714 4.571h-125.714q-8 0-13.714-4.571-5.714-3.429-5.714-10.286l9.714-354.857q0-5.714 5.714-10t13.714-4.286h105.714q8 0 13.429 4.286t6 10z" />
|
||||
<glyph unicode="" d="M585.143 164.571v91.429q0 8-5.143 13.143t-13.143 5.143h-54.857v292.571q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h54.857v-182.857h-54.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h256q8 0 13.143 5.143t5.143 13.143zM512 676.571v91.429q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
||||
<glyph unicode="" d="M733.714 531.428q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
||||
<glyph unicode="" d="M658.286 475.428q0 105.714-75.143 180.857t-180.857 75.143-180.857-75.143-75.143-180.857 75.143-180.857 180.857-75.143 180.857 75.143 75.143 180.857zM950.857 0q0-29.714-21.714-51.429t-51.429-21.714q-30.857 0-51.429 21.714l-196 195.429q-102.286-70.857-228-70.857-81.714 0-156.286 31.714t-128.571 85.714-85.714 128.571-31.714 156.286 31.714 156.286 85.714 128.571 128.571 85.714 156.286 31.714 156.286-31.714 128.571-85.714 85.714-128.571 31.714-156.286q0-125.714-70.857-228l196-196q21.143-21.143 21.143-51.429z" horiz-adv-x="951" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 2.9 KiB |
BIN
docs/source/fonts/slate.ttf
Executable file
BIN
docs/source/fonts/slate.ttf
Executable file
Binary file not shown.
BIN
docs/source/fonts/slate.woff
Executable file
BIN
docs/source/fonts/slate.woff
Executable file
Binary file not shown.
BIN
docs/source/fonts/slate.woff2
Executable file
BIN
docs/source/fonts/slate.woff2
Executable file
Binary file not shown.
BIN
docs/source/images/github.png
Normal file
BIN
docs/source/images/github.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
docs/source/images/logo.png
Normal file
BIN
docs/source/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
docs/source/images/navbar.png
Normal file
BIN
docs/source/images/navbar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 96 B |
238
docs/source/includes/_api_reference copy.md
Normal file
238
docs/source/includes/_api_reference copy.md
Normal file
|
@ -0,0 +1,238 @@
|
|||
|
||||
# API Reference
|
||||
|
||||
## Cell Module
|
||||
|
||||
### cell class
|
||||
|
||||
Describes cell associated properties.
|
||||
|
||||
Properties of interest include style, type, value, and address. The Cell class is required to know its value and type, display options, and any other features of an Excel cell.Utilities for referencing cells using Excel’s ‘A1’ column/row nomenclature are also provided.
|
||||
|
||||
#### `cell(const cell&)`
|
||||
Default copy constructor.
|
||||
|
||||
#### `bool has_value() const`
|
||||
Return true if value has been set and has not been cleared using cell::clear_value().
|
||||
|
||||
#### `template <typename T> T value() const`
|
||||
Return the value of this cell as an instance of type T. Overloads exist for most C++ fundamental types like bool, int, etc. as well as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
|
||||
#### `void clear_value()`
|
||||
Make this cell have a value of type null. All other cell attributes are retained.
|
||||
|
||||
#### `template <typename T> void value(T value)`
|
||||
Set the value of this cell to the given value. Overloads exist for most C++ fundamental types like bool, int, etc. as well as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
|
||||
#### `void value(const std::string &string_value, bool infer_type)`
|
||||
Analyze string_value to determine its type, convert it to that type, and set the value of this cell to that converted value.
|
||||
|
||||
#### `type data_type() const`
|
||||
Return the type of this cell.
|
||||
|
||||
#### `void data_type(type t)`
|
||||
Set the type of this cell.
|
||||
|
||||
#### `bool garbage_collectible() const`
|
||||
There’s no reason to keep a cell which has no value and is not a placeholder. Return true if this cell has no value, style, isn’t merged, etc.
|
||||
|
||||
#### `bool is_date() const`
|
||||
Return true iff this cell’s number format matches a date format.
|
||||
|
||||
#### `cell_reference reference() const`
|
||||
Return a cell_reference that points to the location of this cell.
|
||||
|
||||
#### `column_t column() const`
|
||||
Return the column of this cell.
|
||||
|
||||
#### `row_t row() const`
|
||||
Return the row of this cell.
|
||||
|
||||
#### `std::pair<int, int> anchor() const`
|
||||
Return the location of this cell as an ordered pair.
|
||||
|
||||
#### `std::string hyperlink() const`
|
||||
Return the URL of this cell’s hyperlink.
|
||||
|
||||
#### `void hyperlink(const std::string &value)`
|
||||
Add a hyperlink to this cell pointing to the URI of the given value.
|
||||
|
||||
#### `bool has_hyperlink() const`
|
||||
Return true if this cell has a hyperlink set.
|
||||
|
||||
#### `class alignment computed_alignment() const`
|
||||
Returns the result of computed_format().alignment().
|
||||
|
||||
#### `class border computed_border() const`
|
||||
Returns the result of computed_format().border().
|
||||
|
||||
#### `class fill computed_fill() const`
|
||||
Returns the result of computed_format().fill().
|
||||
|
||||
#### `class font computed_font() const`
|
||||
Returns the result of computed_format().font().
|
||||
|
||||
#### `class number_format computed_number_format() const`
|
||||
Returns the result of computed_format().number_format().
|
||||
|
||||
#### `class protection computed_protection() const`
|
||||
Returns the result of computed_format().protection().
|
||||
|
||||
#### `bool has_format() const`
|
||||
Return true if this cell has had a format applied to it.
|
||||
|
||||
#### `const class format format() const`
|
||||
Return a reference to the format applied to this cell. If this cell has no format, an invalid_attribute exception will be thrown.
|
||||
|
||||
#### `void format(const class format new_format)`
|
||||
Applies the cell-level formatting of new_format to this cell.
|
||||
|
||||
#### `void clear_format()`
|
||||
Remove the cell-level formatting from this cell. This doesn’t affect the style that may also be applied to the cell. Throws an invalid_attribute exception if no format is applied.
|
||||
|
||||
#### `class number_format number_format() const`
|
||||
Returns the number format of this cell.
|
||||
|
||||
#### `void number_format(const class number_format &format)`
|
||||
Creates a new format in the workbook, sets its number_format to the given format, and applies the format to this cell.
|
||||
|
||||
#### `class font font() const`
|
||||
Returns the font applied to the text in this cell.
|
||||
|
||||
#### `void font(const class font &font_)`
|
||||
Creates a new format in the workbook, sets its font to the given font, and applies the format to this cell.
|
||||
|
||||
#### `class fill fill() const`
|
||||
Returns the fill applied to this cell.
|
||||
|
||||
#### `void fill(const class fill &fill_)`
|
||||
Creates a new format in the workbook, sets its fill to the given fill, and applies the format to this cell.
|
||||
|
||||
#### `class border border() const`
|
||||
Returns the border of this cell.
|
||||
|
||||
#### `void border(const class border &border_)`
|
||||
Creates a new format in the workbook, sets its border to the given border, and applies the format to this cell.
|
||||
|
||||
#### `class alignment alignment() const`
|
||||
Returns the alignment of the text in this cell.
|
||||
|
||||
#### `void alignment(const class alignment &alignment_)`
|
||||
Creates a new format in the workbook, sets its alignment to the given alignment, and applies the format to this cell.
|
||||
|
||||
#### `class protection protection() const`
|
||||
Returns the protection of this cell.
|
||||
|
||||
#### `void protection(const class protection &protection_)`
|
||||
Creates a new format in the workbook, sets its protection to the given protection, and applies the format to this cell.
|
||||
|
||||
#### `bool has_style() const`
|
||||
Returns true if this cell has had a style applied to it.
|
||||
|
||||
#### `const class style style() const`
|
||||
Returns a wrapper pointing to the named style applied to this cell.
|
||||
|
||||
#### `void style(const class style &new_style)`
|
||||
Equivalent to style(new_style.name())
|
||||
|
||||
#### `void style(const std::string &style_name)`
|
||||
Sets the named style applied to this cell to a style named style_name. If this style has not been previously created in the workbook, a key_not_found exception will be thrown.
|
||||
|
||||
#### `void clear_style()`
|
||||
Removes the named style from this cell. An invalid_attribute exception will be thrown if this cell has no style. This will not affect the cell format of the cell.
|
||||
|
||||
#### `std::string formula() const`
|
||||
Returns the string representation of the formula applied to this cell.
|
||||
|
||||
#### `void formula(const std::string &formula)`
|
||||
Sets the formula of this cell to the given value. This formula string should begin with ‘=’.
|
||||
|
||||
#### `void clear_formula()`
|
||||
Removes the formula from this cell. After this is called, has_formula() will return false.
|
||||
|
||||
#### `bool has_formula() const`
|
||||
Returns true if this cell has had a formula applied to it.
|
||||
|
||||
#### `std::string to_string() const`
|
||||
Returns a string representing the value of this cell. If the data type is not a string, it will be converted according to the number format.
|
||||
|
||||
#### `bool is_merged() const`
|
||||
Return true iff this cell has been merged with one or more surrounding cells.
|
||||
|
||||
#### `void merged(bool merged)`
|
||||
Make this a merged cell iff merged is true. Generally, this shouldn’t be called directly. Instead, use worksheet::merge_cells on its parent worksheet.
|
||||
|
||||
#### `std::string error() const`
|
||||
Return the error string that is stored in this cell.
|
||||
|
||||
#### `void error(const std::string &error)`
|
||||
Directly assign the value of this cell to be the given error.
|
||||
|
||||
#### `cell offset(int column, int row)`
|
||||
Return a cell from this cell’s parent workbook at a relative offset given by the parameters.
|
||||
|
||||
#### `class worksheet worksheet()`
|
||||
Return the worksheet that owns this cell.
|
||||
|
||||
#### `const class worksheet worksheet() const`
|
||||
Return the worksheet that owns this cell.
|
||||
|
||||
#### `class workbook &workbook()`
|
||||
Return the workbook of the worksheet that owns this cell.
|
||||
|
||||
#### `const class workbook &workbook() const`
|
||||
Return the workbook of the worksheet that owns this cell.
|
||||
|
||||
#### `calendar base_date() const`
|
||||
Shortcut to return the base date of the parent workbook. Equivalent to workbook().properties().excel_base_date
|
||||
|
||||
#### `std::string check_string(const std::string &to_check)`
|
||||
Return to_check after checking encoding, size, and illegal characters.
|
||||
|
||||
#### `bool has_comment()`
|
||||
Return true if this cell has a comment applied.
|
||||
|
||||
#### `void clear_comment()`
|
||||
Delete the comment applied to this cell if it exists.
|
||||
|
||||
#### `class comment comment()`
|
||||
Get the comment applied to this cell.
|
||||
|
||||
#### `void comment(const std::string &text, const std::string &author = "Microsoft Office User")`
|
||||
Create a new comment with the given text and optional author and apply it to the cell.
|
||||
|
||||
#### `void comment(const std::string &comment_text, const class font &comment_font, const std::string &author = "Microsoft Office User")`
|
||||
Create a new comment with the given text, formatting, and optional author and apply it to the cell.
|
||||
|
||||
#### `void comment(const class comment &new_comment)`
|
||||
Apply the comment provided as the only argument to the cell.
|
||||
|
||||
#### `cell &operator=(const cell &rhs)`
|
||||
Make this cell point to rhs. The cell originally pointed to by this cell will be unchanged.
|
||||
|
||||
#### `bool operator==(const cell &comparand) const`
|
||||
Return true if this cell the same cell as comparand (compare by reference).
|
||||
|
||||
#### `bool operator==(std::nullptr_t) const`
|
||||
Return true if this cell is uninitialized.
|
||||
|
||||
#### `static const std::unordered_map<std::string, int> &error_codes()`
|
||||
Return a map of error strings such as #DIV/0! and their associated indices.
|
||||
|
||||
### cell_reference class
|
||||
|
||||
#### `cell_reference()`
|
||||
|
||||
Default constructor makes a reference to the top-left-most cell, “A1”.
|
||||
|
||||
#### `cell_reference(const char *reference_string)`
|
||||
|
||||
Constructs a cell_reference from a string reprenting a cell coordinate (e.g. $B14).
|
||||
|
||||
## Workbook Module
|
||||
|
||||
### workbook class
|
||||
|
||||
#### `workbook::workbook()`
|
||||
|
||||
Constructs a workbook.
|
1626
docs/source/includes/_api_reference.md
Normal file
1626
docs/source/includes/_api_reference.md
Normal file
File diff suppressed because it is too large
Load Diff
31
docs/source/includes/_contributing.md
Normal file
31
docs/source/includes/_contributing.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Contributing to xlnt
|
||||
|
||||
xlnt welcomes contributions from everyone regardless of skill level (provided you can write C++ or documentation).
|
||||
|
||||
## Getting Started
|
||||
|
||||
Look through the list of issues to find something interesting to work on. Help is appreciated with any issues, but important timely issues are labeled as "help wanted". Issues labeled "docs" might be good for those who want to contribute without having to know too much C++. You might also find something that the code is missing without an associated issue. That's fine to work on to, but it might be best to make an issue first in case someone else is working on it.
|
||||
|
||||
## Contributions
|
||||
|
||||
Contributions to xlnt should be made in the form of pull requests on GitHub. Each pull request will be reviewed and either merged into the current development branch or given feedback for changes that would be required to do so.
|
||||
|
||||
All code in this repository is under the MIT License. You should agree to these terms before submitting any code to xlnt.
|
||||
|
||||
## Pull Request Checklist
|
||||
|
||||
- Branch from the head of the current development branch. Until version 1.0 is released, this the master branch.
|
||||
|
||||
- Commits should be as small as possible, while ensuring that each commit is correct independently (i.e. each commit should compile and pass all tests). Commits that don't follow the coding style indicated in .clang-format (e.g. indentation) are less likely to be accepted until they are fixed.
|
||||
|
||||
- If your pull request is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment.
|
||||
|
||||
- Add tests relevant to the fixed defect or new feature. It's best to do this before making any changes, make sure that the tests fail, then make changes ensuring that it ultimately passes the tests (i.e. TDD). xlnt uses cxxtest for testing. Tests are contained in a tests directory inside each module (e.g. source/workbook/tests/test_workbook.hpp) in the form of a header file. Each test is a separate function with a name that starts like "test_". See http://cxxtest.com/guide.html for information about CxxTest or take a look at existing tests.
|
||||
|
||||
## Conduct
|
||||
|
||||
Just try to be nice--we're all volunteers here.
|
||||
|
||||
## Communication
|
||||
|
||||
Add a comment to an existing issue on GitHub, open a new issue for defects or feature requests, or contact @tfussell if you want.
|
37
docs/source/includes/_formatting.md
Normal file
37
docs/source/includes/_formatting.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
|
||||
# Formatting
|
||||
|
||||
## Format vs. Style
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto cell = wb.active_sheet().cell("A1");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
In the context of xlnt, format and style have specific distinct meanings. A style in xlnt corresponds to a named style created in the "Cell styles" dropdown in Excel. It must have a name and optionally any of: alignment, border, fill, font, number format, protection. A format in xlnt corresponds to the alignment, border, fill, font, number format, and protection settings applied to a cell via right-click->"Format Cells". A cell can have both a format and a style. The style properties will generally override the format properties.
|
||||
|
||||
## Number Formatting
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto cell = wb.active_sheet().cell("A1");
|
||||
cell.number_format(xlnt::number_format::percentage());
|
||||
cell.value(0.513);
|
||||
std::cout << cell.to_string() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
An xlnt::number_format is the format code used when displaying a value in a cell. For example, a number_format of "0.00" implies that the number 13.726 should be displayed as "13.73". Many number formats are built-in to Excel and can be access with xlnt::number_format static constructors. Other custom number formats can be created by passing a string to the [xlnt::number_format constructor](#cell-const-cell-amp).
|
20
docs/source/includes/_getting_started.md
Normal file
20
docs/source/includes/_getting_started.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
# Getting Started
|
||||
|
||||
## Getting xlnt
|
||||
|
||||
### Binaries
|
||||
|
||||
### Homebrew
|
||||
|
||||
### Arch
|
||||
|
||||
### vcpkg
|
||||
|
||||
## Compiling from Source
|
||||
|
||||
### CMake
|
||||
|
||||
### Dependencies
|
||||
|
||||
### Static vs. Dynamic
|
79
docs/source/includes/_introduction.md
Normal file
79
docs/source/includes/_introduction.md
Normal file
|
@ -0,0 +1,79 @@
|
|||
|
||||
# Introduction
|
||||
|
||||
```c++
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
xlnt::worksheet ws = wb.active_sheet();
|
||||
ws.cell("A1").value(5);
|
||||
ws.cell("B2").value("string data");
|
||||
ws.cell("C3").formula("=RAND()");
|
||||
ws.merge_cells("C3:C4");
|
||||
ws.freeze_panes("B2");
|
||||
wb.save("xlnt.xlsx");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
xlnt is a C++14 library for reading, writing, and modifying XLSX files as described in [ECMA 376](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The API is based on [openpyxl](https://bitbucket.org/openpyxl/openpyxl), a Python library to read/write Excel 2007 xlsx/xlsm files, and ultimately on [PHPExcel](https://github.com/PHPOffice/PHPExcel), pure PHP library for reading and writing spreadsheet files upon which openpyxl was based. This project is still very much a work in progress, but the core development work is complete.
|
||||
|
||||
## Features
|
||||
|
||||
| Feature | Read | Edit | Write |
|
||||
|---------------------------------------------------------------------|------|------|-------|
|
||||
| Excel-style Workbook | ✓ | ✓ | ✓ |
|
||||
| LibreOffice-style Workbook | ✓ | ✓ | ✓ |
|
||||
| Numbers-style Workbook | ✓ | ✓ | ✓ |
|
||||
| Encrypted Workbook (Excel 2007-2010) | ✓ | ✓ | |
|
||||
| Encrypted Workbook (Excel 2013-2016) | ✓ | ✓ | |
|
||||
| Excel Binary Workbook (.xlsb) | | | |
|
||||
| Excel Macro-Enabled Workbook (.xlsm) | | | |
|
||||
| Excel Macro-Enabled Template (.xltm) | | | |
|
||||
| Document Properties | ✓ | ✓ | ✓ |
|
||||
| Numeric Cell Values | ✓ | ✓ | ✓ |
|
||||
| Inline String Cell Values | ✓ | ✓ | ✓ |
|
||||
| Shared String Cell Values | ✓ | ✓ | ✓ |
|
||||
| Shared String Text Run Formatting (e.g. varied fonts within a cell) | ✓ | ✓ | ✓ |
|
||||
| Hyperlink Cell Values | | | |
|
||||
| Formula Cell Values | | | |
|
||||
| Formula Evaluation | | | |
|
||||
| Page Margins | ✓ | ✓ | ✓ |
|
||||
| Page Setup | | | |
|
||||
| Print Area | | | |
|
||||
| Comments | ✓ | ✓ | |
|
||||
| Header and Footer | | | |
|
||||
| Custom Views | | | |
|
||||
| Charts | | | |
|
||||
| Chartsheets | | | |
|
||||
| Dialogsheets | | | |
|
||||
| Themes | ✓ | | ✓ |
|
||||
| Cell Styles | ✓ | ✓ | ✓ |
|
||||
| Cell Formats | ✓ | ✓ | ✓ |
|
||||
| Formatting->Alignment (e.g. right align) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Border (e.g. red cell outline) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Fill (e.g. green cell background) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Font (e.g. blue cell text) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Number Format (e.g. show 2 decimals) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Protection (e.g. hide formulas) | ✓ | ✓ | ✓ |
|
||||
| Column Styles | | | |
|
||||
| Row Styles | | | |
|
||||
| Sheet Styles | | | |
|
||||
| Conditional Formatting | | | |
|
||||
| Tables | | | |
|
||||
| Table Formatting | | | |
|
||||
| Pivot Tables | | | |
|
||||
| XLSX Thumbnail | ✓ | | ✓ |
|
||||
| Custom OOXML Properties | | | |
|
||||
| Custom OOXML Parts | | | |
|
||||
| Drawing | | | |
|
||||
| Text Box | | | |
|
||||
| WordArt | | | |
|
||||
| Embedded Content (e.g. images) | | | |
|
||||
| Excel VBA | | | |
|
||||
|
||||
## Performance
|
||||
|
||||
Creates a new workbook and writes 1 million cells to a file in X seconds using a fully optimized build on Windows 10 with MSVC 2015.
|
361
docs/source/includes/_license.md
Normal file
361
docs/source/includes/_license.md
Normal file
|
@ -0,0 +1,361 @@
|
|||
# License
|
||||
|
||||
## [xlnt](https://github.com/tfussell/xlnt)
|
||||
|
||||
>[MIT License](https://github.com/tfussell/xlnt/blob/master/LICENSE.md)
|
||||
|
||||
```
|
||||
Copyright (c) 2014-2017 Thomas Fussell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [POLE](http://www.dimin.net/software/pole/)
|
||||
|
||||
>[BSD 2-Clause License](https://bitbucket.org/dimin/pole/src/c15e513bdce4c3a52b3dbc925d4d2bb520dc71d8/pole/LICENSE)
|
||||
|
||||
```
|
||||
POLE - Portable C++ library to access OLE Storage
|
||||
Copyright (C) 2002-2007 Ariya Hidayat (ariya@kde.org). All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
## [Crypto++](https://www.cryptopp.com/)
|
||||
|
||||
>[Boost Software License - Version 1.0](https://www.cryptopp.com/License.txt)
|
||||
|
||||
```
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [libstudxml](http://www.codesynthesis.com/projects/libstudxml/)
|
||||
|
||||
>[MIT License](http://www.codesynthesis.com/licenses/mit.txt)
|
||||
|
||||
```
|
||||
Summary: Everything is licensed under the MIT License (text below).
|
||||
|
||||
Code found in the xml/details/expat/ directory is distributed under
|
||||
the MIT License (see the xml/details/expat/LICENSE file for copyright
|
||||
information).
|
||||
|
||||
Code found in the xml/details/genx/ directory is distributed under
|
||||
the MIT License (see the xml/details/genx/LICENSE file for copyright
|
||||
information).
|
||||
|
||||
The rest is Copyright (c) 2013-2014 Code Synthesis Tools CC and is
|
||||
distributed under the MIT License:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [zlib](http://www.zlib.net/)
|
||||
|
||||
>[zlib License](http://www.zlib.net/zlib_license.html)
|
||||
|
||||
```
|
||||
(C) 1995-2013 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
```
|
||||
|
||||
## [CxxTest](http://cxxtest.com/)
|
||||
|
||||
>[LGPL License](https://github.com/CxxTest/cxxtest/blob/master/COPYING)
|
||||
|
||||
```
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
```
|
||||
|
||||
## [PartIO](https://www.disneyanimation.com/technology/partio.html)
|
||||
|
||||
>[BSD 3-Clause License (with specific non-attribution clause)](https://github.com/wdas/partio/blob/master/src/lib/io/ZIP.h)
|
||||
|
||||
```
|
||||
Copyright 2010 Disney Enterprises, Inc. All rights reserved
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* The names "Disney", "Walt Disney Pictures", "Walt Disney Animation
|
||||
Studios" or the names of its contributors may NOT be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission from Walt Disney Pictures.
|
||||
|
||||
Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
```
|
31
docs/source/includes/_memory_model.md
Normal file
31
docs/source/includes/_memory_model.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
# Memory Model
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
void set_cell(xlnt::cell cell, int value)
|
||||
{
|
||||
cell.value(value);
|
||||
}
|
||||
|
||||
xlnt::workbook create_wb()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.active_sheet();
|
||||
set_cell(wb.cell("A1"), 2);
|
||||
return wb;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
auto wb = create_wb();
|
||||
std::cout << wb.value<int>() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
xlnt uses the pimpl idiom for most of its core data structures. This primary reason for choosing this technique was simplifying usage of the library. Instead of using pointers or references, classes can be passed around by value. Internally they hold a pointer to memory which is within the primary workbook implementation struct. Methods called on the wrapper object dereference the opaque pointer and manipulate its data directly.
|
||||
|
||||
For the user, this means that workbooks, worksheets, cells, formats, and styles can be passed and stored by value.
|
16
docs/source/index.html.md
Normal file
16
docs/source/index.html.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: API Reference
|
||||
|
||||
toc_footers:
|
||||
- <a href='https://github.com/tfussell/xlnt'><img src='images/github.png' id='github-icon'/>GitHub Repo</a>
|
||||
|
||||
includes:
|
||||
- introduction
|
||||
- getting_started
|
||||
- memory_model
|
||||
- formatting
|
||||
- api_reference
|
||||
- license
|
||||
|
||||
search: true
|
||||
---
|
4
docs/source/javascripts/all.js
Normal file
4
docs/source/javascripts/all.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
//= require ./lib/_energize
|
||||
//= require ./app/_lang
|
||||
//= require ./app/_search
|
||||
//= require ./app/_toc
|
3
docs/source/javascripts/all_nosearch.js
Normal file
3
docs/source/javascripts/all_nosearch.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
//= require ./lib/_energize
|
||||
//= require ./app/_lang
|
||||
//= require ./app/_toc
|
166
docs/source/javascripts/app/_lang.js
Normal file
166
docs/source/javascripts/app/_lang.js
Normal file
|
@ -0,0 +1,166 @@
|
|||
//= require ../lib/_jquery
|
||||
|
||||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
(function (global) {
|
||||
'use strict';
|
||||
|
||||
var languages = [];
|
||||
|
||||
global.setupLanguages = setupLanguages;
|
||||
global.activateLanguage = activateLanguage;
|
||||
|
||||
function activateLanguage(language) {
|
||||
if (!language) return;
|
||||
if (language === "") return;
|
||||
|
||||
$(".lang-selector a").removeClass('active');
|
||||
$(".lang-selector a[data-language-name='" + language + "']").addClass('active');
|
||||
for (var i=0; i < languages.length; i++) {
|
||||
$(".highlight." + languages[i]).hide();
|
||||
$(".lang-specific." + languages[i]).hide();
|
||||
}
|
||||
$(".highlight." + language).show();
|
||||
$(".lang-specific." + language).show();
|
||||
|
||||
global.toc.calculateHeights();
|
||||
|
||||
// scroll to the new location of the position
|
||||
if ($(window.location.hash).get(0)) {
|
||||
$(window.location.hash).get(0).scrollIntoView(true);
|
||||
}
|
||||
}
|
||||
|
||||
// parseURL and stringifyURL are from https://github.com/sindresorhus/query-string
|
||||
// MIT licensed
|
||||
// https://github.com/sindresorhus/query-string/blob/7bee64c16f2da1a326579e96977b9227bf6da9e6/license
|
||||
function parseURL(str) {
|
||||
if (typeof str !== 'string') {
|
||||
return {};
|
||||
}
|
||||
|
||||
str = str.trim().replace(/^(\?|#|&)/, '');
|
||||
|
||||
if (!str) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return str.split('&').reduce(function (ret, param) {
|
||||
var parts = param.replace(/\+/g, ' ').split('=');
|
||||
var key = parts[0];
|
||||
var val = parts[1];
|
||||
|
||||
key = decodeURIComponent(key);
|
||||
// missing `=` should be `null`:
|
||||
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
||||
val = val === undefined ? null : decodeURIComponent(val);
|
||||
|
||||
if (!ret.hasOwnProperty(key)) {
|
||||
ret[key] = val;
|
||||
} else if (Array.isArray(ret[key])) {
|
||||
ret[key].push(val);
|
||||
} else {
|
||||
ret[key] = [ret[key], val];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}, {});
|
||||
};
|
||||
|
||||
function stringifyURL(obj) {
|
||||
return obj ? Object.keys(obj).sort().map(function (key) {
|
||||
var val = obj[key];
|
||||
|
||||
if (Array.isArray(val)) {
|
||||
return val.sort().map(function (val2) {
|
||||
return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
|
||||
}).join('&');
|
||||
}
|
||||
|
||||
return encodeURIComponent(key) + '=' + encodeURIComponent(val);
|
||||
}).join('&') : '';
|
||||
};
|
||||
|
||||
// gets the language set in the query string
|
||||
function getLanguageFromQueryString() {
|
||||
if (location.search.length >= 1) {
|
||||
var language = parseURL(location.search).language
|
||||
if (language) {
|
||||
return language;
|
||||
} else if (jQuery.inArray(location.search.substr(1), languages) != -1) {
|
||||
return location.search.substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// returns a new query string with the new language in it
|
||||
function generateNewQueryString(language) {
|
||||
var url = parseURL(location.search);
|
||||
if (url.language) {
|
||||
url.language = language;
|
||||
return stringifyURL(url);
|
||||
}
|
||||
return language;
|
||||
}
|
||||
|
||||
// if a button is clicked, add the state to the history
|
||||
function pushURL(language) {
|
||||
if (!history) { return; }
|
||||
var hash = window.location.hash;
|
||||
if (hash) {
|
||||
hash = hash.replace(/^#+/, '');
|
||||
}
|
||||
history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash);
|
||||
|
||||
// save language as next default
|
||||
localStorage.setItem("language", language);
|
||||
}
|
||||
|
||||
function setupLanguages(l) {
|
||||
var defaultLanguage = localStorage.getItem("language");
|
||||
|
||||
languages = l;
|
||||
|
||||
var presetLanguage = getLanguageFromQueryString();
|
||||
if (presetLanguage) {
|
||||
// the language is in the URL, so use that language!
|
||||
activateLanguage(presetLanguage);
|
||||
|
||||
localStorage.setItem("language", presetLanguage);
|
||||
} else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) {
|
||||
// the language was the last selected one saved in localstorage, so use that language!
|
||||
activateLanguage(defaultLanguage);
|
||||
} else {
|
||||
// no language selected, so use the default
|
||||
activateLanguage(languages[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// if we click on a language tab, activate that language
|
||||
$(function() {
|
||||
$(".lang-selector a").on("click", function() {
|
||||
var language = $(this).data("language-name");
|
||||
pushURL(language);
|
||||
activateLanguage(language);
|
||||
return false;
|
||||
});
|
||||
window.onpopstate = function() {
|
||||
activateLanguage(getLanguageFromQueryString());
|
||||
};
|
||||
});
|
||||
})(window);
|
75
docs/source/javascripts/app/_search.js
Normal file
75
docs/source/javascripts/app/_search.js
Normal file
|
@ -0,0 +1,75 @@
|
|||
//= require ../lib/_lunr
|
||||
//= require ../lib/_jquery
|
||||
//= require ../lib/_jquery.highlight
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var content, searchResults;
|
||||
var highlightOpts = { element: 'span', className: 'search-highlight' };
|
||||
|
||||
var index = new lunr.Index();
|
||||
|
||||
index.ref('id');
|
||||
index.field('title', { boost: 10 });
|
||||
index.field('body');
|
||||
index.pipeline.add(lunr.trimmer, lunr.stopWordFilter);
|
||||
|
||||
$(populate);
|
||||
$(bind);
|
||||
|
||||
function populate() {
|
||||
$('h1, h2, h3').each(function() {
|
||||
var title = $(this);
|
||||
var body = title.nextUntil('h1, h2, h3');
|
||||
index.add({
|
||||
id: title.prop('id'),
|
||||
title: title.text(),
|
||||
body: body.text()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function bind() {
|
||||
content = $('.content');
|
||||
searchResults = $('.search-results');
|
||||
|
||||
$('#input-search').on('keyup', search);
|
||||
}
|
||||
|
||||
function search(event) {
|
||||
unhighlight();
|
||||
searchResults.addClass('visible');
|
||||
|
||||
// ESC clears the field
|
||||
if (event.keyCode === 27) this.value = '';
|
||||
|
||||
if (this.value) {
|
||||
var results = index.search(this.value).filter(function(r) {
|
||||
return r.score > 0.0001;
|
||||
});
|
||||
|
||||
if (results.length) {
|
||||
searchResults.empty();
|
||||
$.each(results, function (index, result) {
|
||||
var elem = document.getElementById(result.ref);
|
||||
searchResults.append("<li><a href='#" + result.ref + "'>" + $(elem).text() + "</a></li>");
|
||||
});
|
||||
highlight.call(this);
|
||||
} else {
|
||||
searchResults.html('<li></li>');
|
||||
$('.search-results li').text('No Results Found for "' + this.value + '"');
|
||||
}
|
||||
} else {
|
||||
unhighlight();
|
||||
searchResults.removeClass('visible');
|
||||
}
|
||||
}
|
||||
|
||||
function highlight() {
|
||||
if (this.value) content.highlight(this.value, highlightOpts);
|
||||
}
|
||||
|
||||
function unhighlight() {
|
||||
content.unhighlight(highlightOpts);
|
||||
}
|
||||
})();
|
57
docs/source/javascripts/app/_toc.js
Normal file
57
docs/source/javascripts/app/_toc.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
//= require ../lib/_jquery
|
||||
//= require ../lib/_jquery_ui
|
||||
//= require ../lib/_jquery.tocify
|
||||
//= require ../lib/_imagesloaded.min
|
||||
(function (global) {
|
||||
'use strict';
|
||||
|
||||
var closeToc = function() {
|
||||
$(".tocify-wrapper").removeClass('open');
|
||||
$("#nav-button").removeClass('open');
|
||||
};
|
||||
|
||||
var makeToc = function() {
|
||||
global.toc = $("#toc").tocify({
|
||||
selectors: 'h1, h2, h3, h4',
|
||||
extendPage: false,
|
||||
theme: 'none',
|
||||
smoothScroll: false,
|
||||
showEffectSpeed: 0,
|
||||
hideEffectSpeed: 180,
|
||||
ignoreSelector: '.toc-ignore',
|
||||
highlightOffset: 60,
|
||||
scrollTo: -1,
|
||||
scrollHistory: true,
|
||||
hashGenerator: function (text, element) {
|
||||
return element.prop('id');
|
||||
}
|
||||
}).data('toc-tocify');
|
||||
|
||||
$("#nav-button").click(function() {
|
||||
$(".tocify-wrapper").toggleClass('open');
|
||||
$("#nav-button").toggleClass('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
$(".page-wrapper").click(closeToc);
|
||||
$(".tocify-item").click(closeToc);
|
||||
};
|
||||
|
||||
// Hack to make already open sections to start opened,
|
||||
// instead of displaying an ugly animation
|
||||
function animate() {
|
||||
setTimeout(function() {
|
||||
toc.setOption('showEffectSpeed', 180);
|
||||
}, 50);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
makeToc();
|
||||
animate();
|
||||
setupLanguages($('body').data('languages'));
|
||||
$('.content').imagesLoaded( function() {
|
||||
global.toc.calculateHeights();
|
||||
});
|
||||
});
|
||||
})(window);
|
||||
|
96
docs/source/layouts/layout.erb
Normal file
96
docs/source/layouts/layout.erb
Normal file
|
@ -0,0 +1,96 @@
|
|||
<%#
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
%>
|
||||
<% language_tabs = current_page.data.language_tabs || [] %>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title><%= current_page.data.title || "API Documentation" %></title>
|
||||
|
||||
<style>
|
||||
<%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %>
|
||||
</style>
|
||||
<%= stylesheet_link_tag :screen, media: :screen %>
|
||||
<%= stylesheet_link_tag :print, media: :print %>
|
||||
<% if current_page.data.search %>
|
||||
<%= javascript_include_tag "all" %>
|
||||
<% else %>
|
||||
<%= javascript_include_tag "all_nosearch" %>
|
||||
<% end %>
|
||||
</head>
|
||||
|
||||
<body class="<%= page_classes %>" data-languages="<%=h language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>">
|
||||
<a href="#" id="nav-button">
|
||||
<span>
|
||||
NAV
|
||||
<%= image_tag('navbar.png') %>
|
||||
</span>
|
||||
</a>
|
||||
<div class="tocify-wrapper">
|
||||
<%= image_tag "logo.png" %>
|
||||
<% if language_tabs.any? %>
|
||||
<div class="lang-selector">
|
||||
<% language_tabs.each do |lang| %>
|
||||
<% if lang.is_a? Hash %>
|
||||
<a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
|
||||
<% else %>
|
||||
<a href="#" data-language-name="<%= lang %>"><%= lang %></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if current_page.data.search %>
|
||||
<div class="search">
|
||||
<input type="text" class="search" id="input-search" placeholder="Search">
|
||||
</div>
|
||||
<ul class="search-results"></ul>
|
||||
<% end %>
|
||||
<div id="toc">
|
||||
</div>
|
||||
<% if current_page.data.toc_footers %>
|
||||
<ul class="toc-footer">
|
||||
<% current_page.data.toc_footers.each do |footer| %>
|
||||
<li><%= footer %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="page-wrapper">
|
||||
<div class="dark-box"></div>
|
||||
<div class="content">
|
||||
<%= yield %>
|
||||
<% current_page.data.includes && current_page.data.includes.each do |include| %>
|
||||
<%= partial "includes/#{include}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="dark-box">
|
||||
<% if language_tabs.any? %>
|
||||
<div class="lang-selector">
|
||||
<% language_tabs.each do |lang| %>
|
||||
<% if lang.is_a? Hash %>
|
||||
<a href="#" data-language-name="<%= lang.keys.first %>"><%= lang.values.first %></a>
|
||||
<% else %>
|
||||
<a href="#" data-language-name="<%= lang %>"><%= lang %></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
38
docs/source/stylesheets/_icon-font.scss
Normal file
38
docs/source/stylesheets/_icon-font.scss
Normal file
|
@ -0,0 +1,38 @@
|
|||
@font-face {
|
||||
font-family: 'slate';
|
||||
src:font-url('slate.eot?-syv14m');
|
||||
src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'),
|
||||
font-url('slate.woff2?-syv14m') format('woff2'),
|
||||
font-url('slate.woff?-syv14m') format('woff'),
|
||||
font-url('slate.ttf?-syv14m') format('truetype'),
|
||||
font-url('slate.svg?-syv14m#slate') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
%icon {
|
||||
font-family: 'slate';
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
%icon-exclamation-sign {
|
||||
@extend %icon;
|
||||
content: "\e600";
|
||||
}
|
||||
%icon-info-sign {
|
||||
@extend %icon;
|
||||
content: "\e602";
|
||||
}
|
||||
%icon-ok-sign {
|
||||
@extend %icon;
|
||||
content: "\e606";
|
||||
}
|
||||
%icon-search {
|
||||
@extend %icon;
|
||||
content: "\e607";
|
||||
}
|
427
docs/source/stylesheets/_normalize.scss
Normal file
427
docs/source/stylesheets/_normalize.scss
Normal file
|
@ -0,0 +1,427 @@
|
|||
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined for any HTML5 element in IE 8/9.
|
||||
* Correct `block` display not defined for `details` or `summary` in IE 10/11
|
||||
* and Firefox.
|
||||
* Correct `block` display not defined for `main` in IE 11.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
menu,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `inline-block` display not defined in IE 8/9.
|
||||
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
progress,
|
||||
video {
|
||||
display: inline-block; /* 1 */
|
||||
vertical-align: baseline; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `[hidden]` styling not present in IE 8/9/10.
|
||||
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
|
||||
*/
|
||||
|
||||
[hidden],
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background color from active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove border when inside `a` element in IE 8/9/10.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow not hidden in IE 9/10/11.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 8/9 and Safari.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 1em 40px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contain overflow in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address odd `em`-unit font size rendering in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
||||
* styling of `select`, unless a `border` property is set.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 1. Correct color not being inherited.
|
||||
* Known issue: affects color of disabled elements.
|
||||
* 2. Correct font properties not being inherited.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
color: inherit; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
margin: 0; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Address `overflow` set to `hidden` in IE 8/9/10/11.
|
||||
*/
|
||||
|
||||
button {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
||||
* Correct `select` style inheritance in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* It's recommended that you don't attempt to style these elements.
|
||||
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
||||
*
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||
* 2. Remove excess padding in IE 8/9/10.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
||||
* `font-size` values of the `input`, it causes the cursor style of the
|
||||
* decrement button to change from `default` to `text`.
|
||||
*/
|
||||
|
||||
input[type="number"]::-webkit-inner-spin-button,
|
||||
input[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
||||
* Safari (but not Chrome) clips the cancel button when the search input has
|
||||
* padding (and `textfield` appearance).
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #c0c0c0;
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9/10/11.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default vertical scrollbar in IE 8/9/10/11.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't inherit the `font-weight` (applied by a rule above).
|
||||
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
||||
*/
|
||||
|
||||
optgroup {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
padding: 0;
|
||||
}
|
105
docs/source/stylesheets/_variables.scss
Normal file
105
docs/source/stylesheets/_variables.scss
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// CUSTOMIZE SLATE
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Use these settings to help adjust the appearance of Slate
|
||||
|
||||
|
||||
// BACKGROUND COLORS
|
||||
////////////////////
|
||||
$nav-bg: #393939 !default;
|
||||
$examples-bg: #393939 !default;
|
||||
$code-bg: #292929 !default;
|
||||
$code-annotation-bg: #1c1c1c !default;
|
||||
$nav-subitem-bg: #262626 !default;
|
||||
$nav-active-bg: #2467af !default;
|
||||
$lang-select-border: #000 !default;
|
||||
$lang-select-bg: #222 !default;
|
||||
$lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something
|
||||
$lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed
|
||||
$main-bg: #eaf2f6 !default;
|
||||
$aside-notice-bg: #8fbcd4 !default;
|
||||
$aside-warning-bg: #c97a7e !default;
|
||||
$aside-success-bg: #6ac174 !default;
|
||||
$search-notice-bg: #c97a7e !default;
|
||||
|
||||
|
||||
// TEXT COLORS
|
||||
////////////////////
|
||||
$main-text: #333 !default; // main content text color
|
||||
$nav-text: #fff !default;
|
||||
$nav-active-text: #fff !default;
|
||||
$lang-select-text: #fff !default; // color of unselected language tab text
|
||||
$lang-select-active-text: #fff !default; // color of selected language tab text
|
||||
$lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed
|
||||
|
||||
|
||||
// SIZES
|
||||
////////////////////
|
||||
$nav-width: 230px !default; // width of the navbar
|
||||
$examples-width: 50% !default; // portion of the screen taken up by code examples
|
||||
$logo-margin: 20px !default; // margin between nav items and logo, ignored if search is active
|
||||
$main-padding: 28px !default; // padding to left and right of content & examples
|
||||
$nav-padding: 15px !default; // padding to left and right of navbar
|
||||
$nav-v-padding: 10px !default; // padding used vertically around search boxes and results
|
||||
$nav-indent: 10px !default; // extra padding for ToC subitems
|
||||
$code-annotation-padding: 13px !default; // padding inside code annotations
|
||||
$h1-margin-bottom: 21px !default; // padding under the largest header tags
|
||||
$tablet-width: 930px !default; // min width before reverting to tablet size
|
||||
$phone-width: $tablet-width - $nav-width !default; // min width before reverting to mobile size
|
||||
|
||||
|
||||
// FONTS
|
||||
////////////////////
|
||||
%default-font {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
%header-font {
|
||||
@extend %default-font;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
%code-font {
|
||||
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
// OTHER
|
||||
////////////////////
|
||||
$nav-active-shadow: #000 !default;
|
||||
$nav-footer-border-color: #666 !default;
|
||||
$nav-embossed-border-top: #000 !default;
|
||||
$nav-embossed-border-bottom: #939393 !default;
|
||||
$main-embossed-text-shadow: 0px 1px 0px #fff !default;
|
||||
$search-box-border-color: #666 !default;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// INTERNAL
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// These settings are probably best left alone.
|
||||
|
||||
%break-words {
|
||||
word-break: break-all;
|
||||
hyphens: auto;
|
||||
}
|
147
docs/source/stylesheets/print.css.scss
Normal file
147
docs/source/stylesheets/print.css.scss
Normal file
|
@ -0,0 +1,147 @@
|
|||
@charset "utf-8";
|
||||
@import 'normalize';
|
||||
@import 'variables';
|
||||
@import 'icon-font';
|
||||
|
||||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
$print-color: #999;
|
||||
$print-color-light: #ccc;
|
||||
$print-font-size: 12px;
|
||||
|
||||
body {
|
||||
@extend %default-font;
|
||||
}
|
||||
|
||||
.tocify, .toc-footer, .lang-selector, .search, #nav-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tocify-wrapper>img {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 12px;
|
||||
|
||||
pre, code {
|
||||
@extend %code-font;
|
||||
@extend %break-words;
|
||||
border: 1px solid $print-color;
|
||||
border-radius: 5px;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
pre {
|
||||
code {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 1.3em;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 0.2em;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid $print-color;
|
||||
tr {
|
||||
border-bottom: 1px solid $print-color;
|
||||
}
|
||||
td,th {
|
||||
padding: 0.7em;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@extend %header-font;
|
||||
font-size: 2.5em;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
margin-top: 1em;
|
||||
margin-bottom: $h1-margin-bottom;
|
||||
border: 2px solid $print-color-light;
|
||||
border-width: 2px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@extend %header-font;
|
||||
font-size: 1.8em;
|
||||
margin-top: 2em;
|
||||
border-top: 2px solid $print-color-light;
|
||||
padding-top: 0.8em;
|
||||
}
|
||||
|
||||
h1+h2, h1+div+h2 {
|
||||
border-top: none;
|
||||
padding-top: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
h3, h4 {
|
||||
@extend %header-font;
|
||||
font-size: 0.8em;
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 0.8em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h5, h6 {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
aside {
|
||||
padding: 1em;
|
||||
border: 1px solid $print-color-light;
|
||||
border-radius: 5px;
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
aside:before {
|
||||
vertical-align: middle;
|
||||
padding-right: 0.5em;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
aside.notice:before {
|
||||
@extend %icon-info-sign;
|
||||
}
|
||||
|
||||
aside.warning:before {
|
||||
@extend %icon-exclamation-sign;
|
||||
}
|
||||
|
||||
aside.success:before {
|
||||
@extend %icon-ok-sign;
|
||||
}
|
||||
}
|
634
docs/source/stylesheets/screen.css.scss
Normal file
634
docs/source/stylesheets/screen.css.scss
Normal file
|
@ -0,0 +1,634 @@
|
|||
@charset "utf-8";
|
||||
@import 'normalize';
|
||||
@import 'variables';
|
||||
@import 'icon-font';
|
||||
|
||||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// GENERAL STUFF
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
html, body {
|
||||
color: $main-text;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
@extend %default-font;
|
||||
background-color: $main-bg;
|
||||
height: 100%;
|
||||
-webkit-text-size-adjust: none; /* Never autoresize text */
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TABLE OF CONTENTS
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#toc > ul > li > a > span {
|
||||
float: right;
|
||||
background-color: #2484FF;
|
||||
border-radius: 40px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
@mixin embossed-bg {
|
||||
background:
|
||||
linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px),
|
||||
linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px),
|
||||
linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px),
|
||||
linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px),
|
||||
$nav-subitem-bg;
|
||||
}
|
||||
|
||||
.tocify-wrapper {
|
||||
transition: left 0.3s ease-in-out;
|
||||
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
z-index: 30;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: $nav-width;
|
||||
background-color: $nav-bg;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
|
||||
// language selector for mobile devices
|
||||
.lang-selector {
|
||||
display: none;
|
||||
a {
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
// This is the logo at the top of the ToC
|
||||
&>img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&>.search {
|
||||
position: relative;
|
||||
|
||||
input {
|
||||
background: $nav-bg;
|
||||
border-width: 0 0 1px 0;
|
||||
border-color: $search-box-border-color;
|
||||
padding: 6px 0 6px 20px;
|
||||
box-sizing: border-box;
|
||||
margin: $nav-v-padding $nav-padding;
|
||||
width: $nav-width - 30;
|
||||
outline: none;
|
||||
color: $nav-text;
|
||||
border-radius: 0; /* ios has a default border radius */
|
||||
}
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
left: $nav-padding;
|
||||
color: $nav-text;
|
||||
@extend %icon-search;
|
||||
}
|
||||
}
|
||||
|
||||
img+.tocify, .lang-selector+.tocify {
|
||||
margin-top: $logo-margin;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
margin-top: 0;
|
||||
box-sizing: border-box;
|
||||
height: 0;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
transition-property: height, margin;
|
||||
transition-duration: 180ms;
|
||||
transition-timing-function: ease-in-out;
|
||||
&.visible {
|
||||
height: 30%;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
@include embossed-bg;
|
||||
|
||||
li {
|
||||
margin: 1em $nav-padding;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $nav-text;
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tocify-item>a, .toc-footer li {
|
||||
padding: 0 $nav-padding 0 $nav-padding;
|
||||
display: block;
|
||||
overflow-x: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
// The Table of Contents is composed of multiple nested
|
||||
// unordered lists. These styles remove the default
|
||||
// styling of an unordered list because it is ugly.
|
||||
ul, li {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
li {
|
||||
color: $nav-text;
|
||||
transition-property: background;
|
||||
transition-timing-function: linear;
|
||||
transition-duration: 230ms;
|
||||
}
|
||||
|
||||
// This is the currently selected ToC entry
|
||||
.tocify-focus {
|
||||
box-shadow: 0px 1px 0px $nav-active-shadow;
|
||||
background-color: $nav-active-bg;
|
||||
color: $nav-active-text;
|
||||
}
|
||||
|
||||
// Subheaders are the submenus that slide open
|
||||
// in the table of contents.
|
||||
.tocify-subheader {
|
||||
display: none; // tocify will override this when needed
|
||||
background-color: $nav-subitem-bg;
|
||||
font-weight: 500;
|
||||
.tocify-item>a {
|
||||
padding-left: $nav-padding + $nav-indent;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
// for embossed look:
|
||||
@include embossed-bg;
|
||||
&>li:last-child {
|
||||
box-shadow: none; // otherwise it'll overflow out of the subheader
|
||||
}
|
||||
}
|
||||
|
||||
.toc-footer {
|
||||
padding: 1em 0;
|
||||
margin-top: 1em;
|
||||
border-top: 1px dashed $nav-footer-border-color;
|
||||
|
||||
li,a {
|
||||
color: $nav-text;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
li {
|
||||
font-size: 0.8em;
|
||||
line-height: 1.7;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// button to show navigation on mobile devices
|
||||
#nav-button {
|
||||
span {
|
||||
display: block;
|
||||
$side-pad: $main-padding / 2 - 8px;
|
||||
padding: $side-pad $side-pad $side-pad;
|
||||
background-color: rgba($main-bg, 0.7);
|
||||
transform-origin: 0 0;
|
||||
transform: rotate(-90deg) translate(-100%, 0);
|
||||
border-radius: 0 0 0 5px;
|
||||
}
|
||||
padding: 0 1.5em 5em 0; // increase touch size area
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
opacity: 0.7;
|
||||
line-height: 16px;
|
||||
img {
|
||||
height: 16px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
transition: left 0.3s ease-in-out;
|
||||
|
||||
&:hover { opacity: 1; }
|
||||
&.open {left: $nav-width}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// PAGE LAYOUT AND CODE SAMPLE BACKGROUND
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
.page-wrapper {
|
||||
margin-left: $nav-width;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
background-color: $main-bg;
|
||||
min-height: 100%;
|
||||
|
||||
padding-bottom: 1px; // prevent margin overflow
|
||||
|
||||
// The dark box is what gives the code samples their dark background.
|
||||
// It sits essentially under the actual content block, which has a
|
||||
// transparent background.
|
||||
// I know, it's hackish, but it's the simplist way to make the left
|
||||
// half of the content always this background color.
|
||||
.dark-box {
|
||||
width: $examples-width;
|
||||
background-color: $examples-bg;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.lang-selector {
|
||||
position: fixed;
|
||||
z-index: 50;
|
||||
border-bottom: 5px solid $lang-select-active-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.lang-selector {
|
||||
background-color: $lang-select-bg;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
a {
|
||||
display: block;
|
||||
float:left;
|
||||
color: $lang-select-text;
|
||||
text-decoration: none;
|
||||
padding: 0 10px;
|
||||
line-height: 30px;
|
||||
outline: 0;
|
||||
|
||||
&:active, &:focus {
|
||||
background-color: $lang-select-pressed-bg;
|
||||
color: $lang-select-pressed-text;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: $lang-select-active-bg;
|
||||
color: $lang-select-active-text;
|
||||
}
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
clear: both;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// CONTENT STYLES
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// This is all the stuff with the light background in the left half of the page
|
||||
|
||||
.content {
|
||||
// to place content above the dark box
|
||||
position: relative;
|
||||
z-index: 30;
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
&>h1, &>h2, &>h3, &>h4, &>h5, &>h6, &>p, &>table, &>ul, &>ol, &>aside, &>dl {
|
||||
margin-right: $examples-width;
|
||||
padding: 0 $main-padding;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
text-shadow: $main-embossed-text-shadow;
|
||||
|
||||
@extend %left-col;
|
||||
}
|
||||
|
||||
&>ul, &>ol {
|
||||
padding-left: $main-padding + 15px;
|
||||
}
|
||||
|
||||
// the div is the tocify hidden div for placeholding stuff
|
||||
&>h1, &>h2, &>div {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@extend %header-font;
|
||||
font-size: 30px;
|
||||
padding-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-bottom: $h1-margin-bottom;
|
||||
margin-top: 2em;
|
||||
border-top: 1px solid #ddd;
|
||||
background-image: linear-gradient(to bottom, #fff, #f9f9f9);
|
||||
}
|
||||
|
||||
h1:first-child, div:first-child + h1 {
|
||||
border-top-width: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@extend %header-font;
|
||||
font-size: 20px;
|
||||
margin-top: 4em;
|
||||
margin-bottom: 0;
|
||||
border-top: 1px solid #ccc;
|
||||
padding-top: 1.2em;
|
||||
padding-bottom: 1.2em;
|
||||
background-image: linear-gradient(to bottom, rgba(#fff, 0.4), rgba(#fff, 0));
|
||||
}
|
||||
|
||||
// h2s right after h1s should bump right up
|
||||
// against the h1s.
|
||||
h1 + h2, h1 + div + h2 {
|
||||
margin-top: $h1-margin-bottom * -1;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
h3, h4, h5, h6 {
|
||||
@extend %header-font;
|
||||
font-size: 15px;
|
||||
margin-top: 2.5em;
|
||||
margin-bottom: 0.8em;
|
||||
}
|
||||
|
||||
h4, h5, h6 {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 2em 0;
|
||||
border-top: 2px solid $examples-bg;
|
||||
border-bottom: 2px solid $main-bg;
|
||||
}
|
||||
|
||||
table {
|
||||
margin-bottom: 1em;
|
||||
overflow: auto;
|
||||
th,td {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
th {
|
||||
padding: 5px 10px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
tr:last-child {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
tr:nth-child(odd)>td {
|
||||
background-color: lighten($main-bg,4.2%);
|
||||
}
|
||||
|
||||
tr:nth-child(even)>td {
|
||||
background-color: lighten($main-bg,2.4%);
|
||||
}
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
p, li, dt, dd {
|
||||
line-height: 1.6;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: rgba(0,0,0,0.05);
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
@extend %break-words;
|
||||
@extend %code-font;
|
||||
}
|
||||
|
||||
pre>code {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
aside {
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
text-shadow: 0 1px 0 lighten($aside-notice-bg, 15%);
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
background: $aside-notice-bg;
|
||||
line-height: 1.6;
|
||||
|
||||
&.warning {
|
||||
background-color: $aside-warning-bg;
|
||||
text-shadow: 0 1px 0 lighten($aside-warning-bg, 15%);
|
||||
}
|
||||
|
||||
&.success {
|
||||
background-color: $aside-success-bg;
|
||||
text-shadow: 0 1px 0 lighten($aside-success-bg, 15%);
|
||||
}
|
||||
}
|
||||
|
||||
aside:before {
|
||||
vertical-align: middle;
|
||||
padding-right: 0.5em;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
aside.notice:before {
|
||||
@extend %icon-info-sign;
|
||||
}
|
||||
|
||||
aside.warning:before {
|
||||
@extend %icon-exclamation-sign;
|
||||
}
|
||||
|
||||
aside.success:before {
|
||||
@extend %icon-ok-sign;
|
||||
}
|
||||
|
||||
.search-highlight {
|
||||
padding: 2px;
|
||||
margin: -2px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #F7E633;
|
||||
text-shadow: 1px 1px 0 #666;
|
||||
background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// CODE SAMPLE STYLES
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// This is all the stuff that appears in the right half of the page
|
||||
|
||||
.content {
|
||||
pre, blockquote {
|
||||
background-color: $code-bg;
|
||||
color: #fff;
|
||||
|
||||
padding: 2em $main-padding;
|
||||
margin: 0;
|
||||
width: $examples-width;
|
||||
|
||||
float:right;
|
||||
clear:right;
|
||||
|
||||
box-sizing: border-box;
|
||||
text-shadow: 0px 1px 2px rgba(0,0,0,0.4);
|
||||
|
||||
@extend %right-col;
|
||||
|
||||
&>p { margin: 0; }
|
||||
|
||||
a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border-bottom: dashed 1px #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
@extend %code-font;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
&>p {
|
||||
background-color: $code-annotation-bg;
|
||||
border-radius: 5px;
|
||||
padding: $code-annotation-padding;
|
||||
color: #ccc;
|
||||
border-top: 1px solid #000;
|
||||
border-bottom: 1px solid #404040;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// RESPONSIVE DESIGN
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// These are the styles for phones and tablets
|
||||
// There are also a couple styles disperesed
|
||||
|
||||
@media (max-width: $tablet-width) {
|
||||
.tocify-wrapper {
|
||||
left: -$nav-width;
|
||||
|
||||
&.open {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.page-wrapper {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
#nav-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tocify-wrapper .tocify-item > a {
|
||||
padding-top: 0.3em;
|
||||
padding-bottom: 0.3em;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $phone-width) {
|
||||
.dark-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
%left-col {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.tocify-wrapper .lang-selector {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.page-wrapper .lang-selector {
|
||||
display: none;
|
||||
}
|
||||
|
||||
%right-col {
|
||||
width: auto;
|
||||
float: none;
|
||||
}
|
||||
|
||||
%right-col + %left-col {
|
||||
margin-top: $main-padding;
|
||||
}
|
||||
}
|
||||
|
||||
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
|
||||
color: #909090;
|
||||
}
|
||||
|
||||
.highlight, .highlight .w {
|
||||
background-color: $code-bg;
|
||||
}
|
||||
|
||||
#github-icon {
|
||||
width: 12px;
|
||||
padding-top: 0px;
|
||||
margin-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
Working with styles
|
||||
===================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Styles are used to change the look of your data while displayed on screen.
|
||||
They are also used to determine the number format being used for a given cell
|
||||
or range of cells.
|
||||
|
||||
Styles can be applied to the following aspects:
|
||||
|
||||
* font to set font size, color, underlining, etc.
|
||||
* fill to set a pattern or color gradient
|
||||
* border to set borders on a cell
|
||||
* cell alignment
|
||||
* protection
|
|
@ -1,5 +0,0 @@
|
|||
Manipulating a workbook in memory
|
||||
=================================
|
||||
|
||||
Create a workbook
|
||||
-----------------
|
|
@ -1,2 +0,0 @@
|
|||
Validating cells
|
||||
================
|
|
@ -1,2 +0,0 @@
|
|||
Testing on Windows
|
||||
==================
|
Loading…
Reference in New Issue
Block a user