Skip to content

Commit

Permalink
Added more default files to be created upon package creation.
Browse files Browse the repository at this point in the history
--HG--
rename : Support/README.rst => data/README.rst
  • Loading branch information
guillermooo committed Apr 25, 2011
1 parent 94540cd commit 24b18e4
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 48 deletions.
44 changes: 0 additions & 44 deletions Support/README.rst

This file was deleted.

35 changes: 35 additions & 0 deletions data/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
================
%(package_name)s
================

<main description>


The Problem
===========

<problem this package tries to solve>


Getting Started
===============

- Install `%(package_name)s`_

.. _%(package_name)s: https://

If you're running a full installation of Sublime Text, simply doublelick on the
``.sublime-package`` file. If you're running a portable installation, you need
to perform an `installation by hand`_.

.. _installation by hand: http://sublimetext.info/docs/extensibility/packages.html#installation-of-packages-with-sublime-package-archives

Once installed, run the following command from the Python console (``Ctrl+```)::

view.run_command("COMMAND")

Alternatively, you can define a new key binding for this command.

How to Use
==========

23 changes: 19 additions & 4 deletions package_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,22 @@
"Snippets",
"Support",
"Docs",
"Macros"
"Macros",
"bin",
"data"
)

# name, default template
DEFAULT_FILES = (
("LICENSE.txt", None),
("README.rst", root_at_packages(THIS_PACKAGE, "Support/README.rst")),
("LICENSE.txt", None),
("README.rst", root_at_packages(THIS_PACKAGE, "data/README.rst")),
(".hgignore", root_at_packages(THIS_PACKAGE, "data/hgignore.txt")),
(".gitignore", root_at_packages(THIS_PACKAGE, "data/gitignore.txt")),
("bin/MakeRelease.ps1", root_at_packages(THIS_PACKAGE, "data/MakeRelease.ps1")),
("bin/CleanUp.ps1", root_at_packages(THIS_PACKAGE, "data/CleanUp.ps1")),
("data/html_template.txt", root_at_packages(THIS_PACKAGE, "data/html_template.txt")),
("data/main.css", root_at_packages(THIS_PACKAGE, "data/main.css")),
("setup.py", root_at_packages(THIS_PACKAGE, "data/setup.py")),
)


Expand Down Expand Up @@ -95,8 +104,14 @@ def create_new(self, name):
for fname, template in DEFAULT_FILES]:
with open(f, 'w') as fh:
if template:
content = "".join(open(template, 'r').readlines()) % \
try:
content = "".join(open(template, 'r').readlines()) % \
{"package_name": name}
except:
pass
finally:
content = "".join(open(template, 'r').readlines())

fh.write(content)

msg = "[NewPackage] Created new package '%s'." % name
Expand Down

0 comments on commit 24b18e4

Please sign in to comment.