Skip to content

Commit

Permalink
Big docs refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Mar 17, 2017
1 parent 9a47f6b commit c376037
Show file tree
Hide file tree
Showing 69 changed files with 3,555 additions and 3,038 deletions.
Binary file added _themes/conan/static/css/book.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions _themes/conan/static/css/signup.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,19 @@
font-size: 17px !important;
color: #C3C4C5 !important;
width: 200px !important;
}


.out-reference-box{
border: 1px solid #848484;
border-left: none;
border-right: none;
padding: 20px;
margin-bottom: 20px;
background-image: url("book.jpg");
background-repeat: no-repeat;
background-position: left;
padding-left: 80px;


}
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
# 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']
#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
Expand Down
2 changes: 1 addition & 1 deletion faq/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ When you are installing packages (with ``conan install`` or ``conan test_package
that you get an error like the following one:


.. code-block:: bash
.. code-block:: text
WARN: Can't find a 'libzmq/4.2.0@memsharded/testing' package for the specified options and settings:
- Settings: arch=x86_64, build_type=Release, compiler=gcc, compiler.libcxx=libstdc++, compiler.version=4.9, os=Windows
Expand Down
3 changes: 0 additions & 3 deletions howtos/cross_building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ We can try to build the hello world example for our own architecture with the ``
...
> Hello World!
*** Running example, will fail by default, implement yours! ***
ERROR: Error 65280 while executing ./example
The test_package command fails because it's only a template and it's asking us to override the default example.
So it's all ok, we've built a Hello World conan package for our own architecture.

From Linux to Windows
Expand Down
68 changes: 64 additions & 4 deletions howtos/python_code_reuse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,21 @@ The specified ``virtualenv`` generator will create an ``activate`` script (in Wi
The above shows an interactive session, but you can import also the functionality in a regular python script.


Reusing python code in your recipes
------------------------------------
-----------------------------------

Requiring a python conan package
________________________________

As the conan recipes are python code itself, it is easy to reuse python packages in them. A basic recipe using the created package would be:

.. code-block:: python
from conans import ConanFile, tools
class HelloPythonReuseConan(ConanFile):
requires = "HelloPy/0.1@memsharded/testing"
def build(self):
with tools.pythonpath(self):
from hello import hello
Expand All @@ -143,3 +145,61 @@ In the above example, the code is reused in the ``build()`` method as an example
...
$ conan build
Hello World from Python!
Sharing a python module
_______________________

Another approach is sharing a python module and exporting within the recipe.

.. _split_conanfile:

Lets write for example a ``msgs.py`` file and put it besides the ``conanfile.py``:

.. code-block:: python
def build_msg(output):
output.info("Building!")
And then the main ``conanfile.py`` would be:

.. code-block:: python
from conans import ConanFile
from msgs import build_msg
class ConanFileToolsTest(ConanFile):
name = "test"
version = "1.9"
exports = "msgs.py" # Important to remember!
def build(self):
build_msg(self.output)
# ...
It is important to note that such ``msgs.py`` file **must be exported** too when exporting the package,
because package recipes must be self-contained.

The code reuse can also be done in the form of a base class, something like a file ``base_conan.py``

.. code-block:: python
from conans import ConanFile
class ConanBase(ConanFile):
# common code here
And then:

.. code-block:: python
from conans import ConanFile
from base_conan import ConanBase
class ConanFileToolsTest(ConanBase):
name = "test"
version = "1.9"
3 changes: 1 addition & 2 deletions integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Integrations
:maxdepth: 2

integrations/cmake
integrations/visual_studio
integrations/makefile
integrations/gcc
integrations/visual_studio
integrations/xcode
integrations/clion
integrations/virtualenv
integrations/ninja
integrations/qmake
integrations/premake
Expand Down
Loading

0 comments on commit c376037

Please sign in to comment.