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

Support for images #12

Closed
dirkrombauts opened this issue Nov 15, 2012 · 13 comments
Closed

Support for images #12

dirkrombauts opened this issue Nov 15, 2012 · 13 comments
Assignees

Comments

@dirkrombauts
Copy link
Member

About what to do next: here’s something that came up in conversation with a colleague: sometimes a picture says more than a thousand words in the description of a feature. Markdown allows us to add links to images (and Pickles correctly outputs the html for them) BUT the paths are screwed up (of course).. It would be nice if the corresponding files would be copied too.

An example: suppose I have “” in my description somewhere. When pickles generates the html, this is rendered as which only works if the html pages are in the same location as the feature files. It would be cool if Pickles would detect this and copy that file. Or maybe we can be lazy and simply copy all image files – perhaps using a naming convention or something like that.

An idea for the naming convention:

  • Given I have a feature called ProcessAccounts.feature
  • When I generate the living documentation
  • Then pickles copies all images called ProcessAccounts_.png, ProcessAccounts_.jpg, ProcessAccounts_.gif, ProcessAccounts_.bmp
@ghost ghost assigned x97mdr Nov 15, 2012
@x97mdr
Copy link
Member

x97mdr commented Nov 15, 2012

I started working on this a few days ago actually. I was thinking of
copying the files into a single location (/images/) in the output
directory. Sadly, when I started working on it on Ubuntu my frustrations
with MonoDevelop grew. I ended up blowing it off my laptop and putting
Windows 8 back on. I'd like to have something working by this weekend.
The naming convention is a great idea in case filenames collide.

I was thinking it should be easy enough to intercept the final HTML (as
XElement) from the HtmlFeatureBuilder, scan it for img tags and move do the
copying from there.

Sorry it's taken so long. This is something people at my office want as
well.

On Thu, Nov 15, 2012 at 1:21 AM, dirkrombauts notifications@github.comwrote:

About what to do next: here’s something that came up in conversation with
a colleague: sometimes a picture says more than a thousand words in the
description of a feature. Markdown allows us to add links to images (and
Pickles correctly outputs the html for them) BUT the paths are screwed up
(of course).. It would be nice if the corresponding files would be copied
too.

An example: suppose I have “” in my description somewhere.
When pickles generates the html, this is rendered as
which only works if the html pages are in the same location as the feature
files. It would be cool if Pickles would detect this and copy that file. Or
maybe we can be lazy and simply copy all image files – perhaps using a
naming convention or something like that.

An idea for the naming convention:

  • Given I have a feature called ProcessAccounts.feature

  • When I generate the living documentation

  • Then pickles copies all images called ProcessAccounts__.png,
    ProcessAccounts__.jpg, ProcessAccounts__.gif, ProcessAccounts__.bmp


    Reply to this email directly or view it on GitHubhttps://github.com/Support for images #12.

@dirkrombauts
Copy link
Member Author

I'd be satisfied if you just blindly copy the files that follow the naming convention, though.

x97mdr added a commit that referenced this issue Jan 5, 2013
Added support for moving images based on relative paths.  Test included.
Tests need to be expanded to handle deeper hierarchies and absolute
paths in the future.
@x97mdr
Copy link
Member

x97mdr commented Jan 5, 2013

I'm starting to push some changes up for this issue. I'll pexk away at it over the next few days. Take a peek when you get a chance.

x97mdr added a commit that referenced this issue Jan 5, 2013
Calling the HtmlImageRelocator to move images
@aaronjrich
Copy link

So this feature will only be supported for the HTML output then?

@x97mdr
Copy link
Member

x97mdr commented Jan 6, 2013

We should support it for all formats, but HTML will be first. Which format
would you like to see implemented?

On Saturday, January 5, 2013, aaronjrich wrote:

So this feature will only be supported for the HTML output then?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-11923331.

@aaronjrich
Copy link

Maybe this doesn't apply to this feature, but the reason I ask is that I'm working on the DHTML output and ran across and issue where the JSON output doesn't have test results at the scenario level. Well, it looked like test results in general are added in by the builder for each output type. I was thinking about this a bit and was considering looking at adding TestResult to Feature and Scenario so it would be in the data and technically other outputs could get at it.

I'd have see what your thinking about with the images - maybe it's something we'd like to use. Have you created something in the Examples project that represents what it will look like?

@x97mdr
Copy link
Member

x97mdr commented Jan 6, 2013

No example just yet, but hopefully by tomorrow

On Saturday, January 5, 2013, aaronjrich wrote:

Maybe this doesn't apply to this feature, but the reason I ask is that I'm
working on the DHTML output and ran across and issue where the JSON output
doesn't have test results at the scenario level. Well, it looked like test
results in general are added in by the builder for each output type. I was
thinking about this a bit and was considering looking at adding TestResult
to Feature and Scenario so it would be in the data and technically other
outputs could get at it.

I'd have see what your thinking about with the images - maybe it's
something we'd like to use. Have you created something in the Examples
project that represents what it will look like?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-11923516.

x97mdr added a commit that referenced this issue Jan 6, 2013
Added an example of image relocation to one of the features in the
example.
@aaronjrich
Copy link

Looking into how this was implemented for the HTML output format, I may be able to use some of this for the DHTML output without too much effort. Wonder if anyone is actively using this feature?

@dirkrombauts
Copy link
Member Author

@aaronjrich regarding your comment to simply take all images we find in the source directory and copy them to the output directory (which I received be email but somehow didn't make it to github): I suggested a naming convention at the top of this issue, but your suggestion is even simpler of course. And seeing as nothing happened with this issue for the past 10 months, it's probably a good idea to make the requirements simpler :-)

So yes, I'm all for it!

@aaronjrich
Copy link

Ran across a scenario in our specs where we refer to an Excel document that contains our "expected" output but there is no way to view this from the Pickled specs. I think we could generalize this image feature request by simply pulling in a white list of files found in the feature source directory (images, office docs, text files?) that we feel may be commonly referenced. Perhaps file types outside the white list can be included via a command line argument or something like that as well if the need arises.

Again, the benefit would be to keep the usage to standard markdown to reference these.

I may take a stab at this for the DHTML format.

@dirkrombauts
Copy link
Member Author

@aaronjrich I added support for images to the HTML version. Would you care to have a go at adding them to the DHTML version?

@aaronjrich
Copy link

I can't commit to a timeframe, but yes, I'd like to get this done. Let me look at how the static version was accomplished.

@dirkrombauts dirkrombauts assigned dirkrombauts and unassigned x97mdr Apr 4, 2014
@dirkrombauts
Copy link
Member Author

I'm closing this issue because it has a new home at uservoice: https://pickles.uservoice.com/forums/232147-general/suggestions/5728981-support-for-images

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