Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updating fubu new docs
Updating the docs to include more of what Josh has done with it.
  • Loading branch information
smerrell committed Apr 2, 2012
1 parent 5ebbeb2 commit 9f9402b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 12 deletions.
5 changes: 4 additions & 1 deletion docs/source/topics/commandline/fubuexe.rst
Expand Up @@ -615,9 +615,12 @@ Creates a new FubuMVC solution (see :ref:`usingfubunew`)

``-g`` - Git repository URL for a FubuMVC template.


``-z`` - The path to a zip file containing a FubuMVC template.

``-s`` - Solution to add the template to.

``-o`` - Override path to where unzipping the template files to (used with ``-s``).

Example usage using a Git repository:

.. code-block:: bash
Expand Down
55 changes: 50 additions & 5 deletions docs/source/topics/commandline/usingfubunew.rst
Expand Up @@ -57,6 +57,20 @@ This will unzip the contents of the ``MyTemplate.zip`` to the folder
``NewTemplateProject`` and run the template transformation on the contents of
the zip file.

.. _fubunew-adding_solution:

Adding a Fubu template to an existing solution
----------------------------------------------

Creating an entirely new solution using :program:`fubu.exe` can be very useful,
but what about the case where we want to add a Fubu template to a solution that
already exists? For that case, we can use the ``-s`` flag on :ref:`fubu-new`.

This will explode the Fubu template into the existing solution directory (which
can be overridden by the ``-o`` flag.) Then we look through the new projects
just created and add them to the solution that was specified using the ``-s``
flag.

.. _fubunew-zip:

Creating your own template zip
Expand All @@ -83,21 +97,38 @@ Once you've extracted the :file:`fubuTemplate.zip` you will see this structure::

Inside of the files will look much like this:

.. literalinclude:: ../../../fubuTemplate/src/FUBUPROJECTNAME\FUBUPROJECTSHORTNAMERegistry.cs
.. literalinclude:: ../../../../fubuTemplates/default/src/FUBUPROJECTNAME\FUBUPROJECTSHORTNAMERegistry.cs
:language: csharp
:linenos:

From this, we can see that there are a few keywords that get replaced when using
:ref:`fubu new <fubu-new>`. This is the list of keywords and corresponding
replacements:

==================================== =========================================
==================================== ===============================================================================
Keyword Replacement
==================================== =========================================
==================================== ===============================================================================
FUBUPROJECTNAME Name put in the fubu new command
FUBUPROJECTSHORTNAME Last part of fubu new name (after last .)
FACEFACE-FACE-FACE-FACE-FACEFACEFACE Guid.NewGuid()
==================================== =========================================
GUIDx (where x is a number) Guid.NewGuid()
==================================== ===============================================================================

.. highlights::

**What does GUIDx mean?**

The GUIDx replacement convention makes it easy for you to create a template that
has multiple projects that need to reference each other.

**Problem:**

You want a new GUID for both projects but need a way to correlate them so that
your second project can reference the first and provide metadata.

**Solution:**

The first project uses "GUID1" as its ID. The second project uses "GUID2" as its
ID. The second project then uses "GUID1" when referring to the first project.

Modifying the template can be as simple as adding extra classes to adding
entirely new Projects.
Expand Down Expand Up @@ -127,6 +158,20 @@ This will clone the git repository `MyFubuTemplate` to the folder
``NewGitBasedproject`` and run the template transformation on the contents of
the cloned repository.

Can't remember long git urls?
'''''''''''''''''''''''''''''

Fortunately there is a way to alias a git url into something more easily
remembered using the ``.fubunew-alias`` file. Simply place the file alongside
:program:`fubu.exe`. The aliases specified in that file can be used with the
`-g` flag.

There also are two default aliases proveded with or without the
``.fubunew-alias`` file. These are:

* fubusln - git://github.com/DarthFubuMVC/rippletemplate.git
* fububottle - git://github.com/DarthFubuMVC/bottle-template.git

.. _fubunew-git:

Creating your own template with git
Expand Down
Expand Up @@ -13,14 +13,14 @@ public FUBUPROJECTSHORTNAMERegistry()
.ToThisAssembly();

Actions
.IncludeClassesSuffixedWithController();

Routes
.IncludeClassesSuffixedWithController();

Routes
.IgnoreControllerNamespaceEntirely();

this.UseSpark();

Views
Import<SparkEngine>();

Views
.TryToAttachWithDefaultConventions();
}
}
Expand Down

0 comments on commit 9f9402b

Please sign in to comment.