Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme is getting longer and longer #17

Closed
tomkowz opened this issue Sep 27, 2014 · 14 comments
Closed

Readme is getting longer and longer #17

tomkowz opened this issue Sep 27, 2014 · 14 comments
Assignees

Comments

@tomkowz
Copy link
Contributor

tomkowz commented Sep 27, 2014

Hi,

At first I want to thanks for this repo, it's great for people who want to read about design patterns in swift and it is good for me, for learning others by contributing and sharing our knowledge and for learning myself when I'm wiring examples of some patterns :)

What this issue is about is maintenance Readme.markdown file. I was thinking a little bit and I'm afraid this file is bulky, hard to browse and maintenance. Wouldn't it be better to move all the patterns implementations to separated .swift files and create links in description to these files (with some description optionally)?

The file could looks like this:

/// Pattern name
/// Xcode version

/** Short description
description here
*/

/// Implementation
implementation here

/// Usage
One or more use cases

What do you think about the idea?

@ochococo
Copy link
Owner

I agree... I like the idea... But the core of this whole repo is the .playground package.

We could split the file, sure... I'll think about it some more and we'll make some move very soon.

@ochococo
Copy link
Owner

ochococo commented Oct 3, 2014

Any ideas how to connect your idea (swift files) with .playground packages?

Mine is:

Separate .markdown, .swift and .playground for every DesignPattern (all autogenerated from .swift file with some ruby script)?

Huh?

@tomkowz
Copy link
Contributor Author

tomkowz commented Oct 3, 2014

Sounds good. My idea was to keep each pattern in separated .swift file, and use some script to merge all files together with some description from markdown - so similar to what you're taking about :) But I don't know Ruby :)

@jpotts18
Copy link
Contributor

What about using Github Wiki for documentation and multiple playground files?

@ochococo
Copy link
Owner

This solution is less portable. Plus - we need some documentation for every pattern. A lot of work.

@jpotts18
Copy link
Contributor

A Github wiki is just a git repository with Markdown files and assets. That seems portable.

On a different note, it seems like the repo could use some renaming and organization.

.
├── docs
│   ├── behavioral.md
│   ├── creational.md
│   └── structural.md
└── patterns (or src)
    ├── behavioral
    │   ├── command.swift
    │   └── iterator.swift
    ├── creational
    │   ├── abstractfactory.swift
    │   ├── builder.swift
    │   ├── factorymethod.swift
    │   ├── prototype.swift
    │   └── singleton.swift
    └── structural
        ├── composite.swift
        └── facade.swift

@jpotts18
Copy link
Contributor

You could also just use another source for your readme.

http://www.blackwasp.co.uk/GangOfFour.aspx

@ochococo
Copy link
Owner

A Github wiki is just a git repository with Markdown files and assets. That seems portable.

Not so much but something has to be done. I agree.

On a different note, it seems like the repo could use some renaming and organization.

I like the idea, but abstractFactory.swift or abstract_factory.swift is better I think.

You could also just use another source for your readme.

Well I could. We could. Care to help with that?

@ochococo ochococo self-assigned this Oct 31, 2014
@ochococo ochococo added this to the Better organization. milestone Oct 31, 2014
@jpotts18
Copy link
Contributor

jpotts18 commented Nov 1, 2014

After investigating the current repo structure I understand your problem better. I think this could be a good solution. It isn't rocket science but that is probably means it is the right answer.

Step One - Rename the files

# new proposed documentation section
├── creational
│   ├── 1-title.md
│   ├── 2-singleton.md
│   ├── 3-builder.md
│   └── 4-abstract-factory.md
└── structural
    ├── 1-title.md
    ├── 2-composite.md
    ├── 3-facade.md
    └── 4-adapter.md

Step Two - Combine all of the files into README.md
Generate our Readme file using cat */* > README.md. This will go recursively through the folders and concatenate all of the markdown files together in order of traversal that is why I had to prepend some numbers to files. Because this is a purely text based approach we could also add swift files and have those concatenated into the README.

# Creational
## Singleton
## Builder
## Abstract Factory
# Structural
## Composite
## Facade
## Adapter

Step Three - Add logic to Generate-playground.sh

Disadvantage:

  • Prepending numbers and other ordering problems.

Advantages:

  • Simple solution
  • Text-based approach offers flexibility
  • File names are more descriptive
  • Generate markdown (or html) for specific sections (i.e. cat creational/* > creational.md | markdown-converter > creational.html

Let me know your thoughts about this approach and I'll gladly contribute it.

@ochococo
Copy link
Owner

ochococo commented Nov 1, 2014

I like this approach, feel free to make that happen.
Not sure we need those prepending numbers. I'd just sort them by name. Prepend title.md with exclamation sign !.

@ochococo
Copy link
Owner

ochococo commented Nov 1, 2014

Oh... Please hurry...
On monday I'll do that myself. 😋

@jpotts18
Copy link
Contributor

jpotts18 commented Nov 1, 2014

Working on it right now

@jpotts18
Copy link
Contributor

jpotts18 commented Nov 1, 2014

#22

@ochococo
Copy link
Owner

ochococo commented Nov 1, 2014

Closing.

@ochococo ochococo closed this as completed Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants