You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2016/07/25 07:08:01 UTC

[GitHub] brooklyn-docs pull request #97: Improves examples copy&pate-ability

GitHub user neykov opened a pull request:

    https://github.com/apache/brooklyn-docs/pull/97

    Improves examples copy&pate-ability

    Remove `$` from line beginnings, so that the example can easily be copy&pasted in the console.
    Also fix tomcat port so that the example works out of the box.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/neykov/brooklyn-docs copy-examples

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-docs/pull/97.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #97
    
----
commit 3e218032cd982cca73c82ef147e26164cca2c113
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2016-07-25T07:06:49Z

    Improves examples copy&pate-ability
    
    Also fix tomcat port

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r72659467
  
    --- Diff: guide/start/policies.md ---
    @@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
     
     {% highlight bash %}
     $ for i in byon{1..4}; do
    -$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | awk '\''{print $2}'\'' | xargs kill -9'
    --- End diff --
    
    Where is our magic that used to treat "$" prefix in a special way (putting it into a separate div, so it wouldn't be included if someone highlighted the text to copy-paste it)? I can't find it.
    
    @drigodwin said that he thinks it may have broken at around the same time as someone did a bootstrap upgrade.
    
    @ahgittin @sjcorbett do you know where that code is?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r72660313
  
    --- Diff: guide/start/policies.md ---
    @@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
     
     {% highlight bash %}
     $ for i in byon{1..4}; do
    -$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | awk '\''{print $2}'\'' | xargs kill -9'
    --- End diff --
    
    I don't.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    i'd prefer a clever solution to avoiding the `$` rather than removing it from the display.  it is used throughout to distinguish what is entered and multi-line from what is returned.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    Closing in favour of #123.
    Good spot on the `curl` argument agree should be safe to remove.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by drigodwin <gi...@git.apache.org>.
Github user drigodwin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    LGTM :thumbsup:


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    The change is not removing all `$`s - it's leaving the one at the command start. The removed characters are in the following lines in a multi-line command. 
    See here for an example of what its trying to fix http://brooklyn.apache.org/v/latest/start/policies.html#auto-scaling.
    The example snippet looks confusing with all those `$` on each line (that's a multi-line command). Messing with copy-pasteability is an additional problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    @neykov if you use the clipboard icon in the corner it does that for you, though i agree if you don't know about it it's irritating -- trying to fix that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    @neykov is https://github.com/apache/brooklyn-docs/pull/123 a better approach?
    no strong feelings if you prefer to remove the `> ` multi-line prompt IE layer this on top of that
    
    i suspect the `-saefafefj` flags to `curl` is a mistake which should be removed (and grep for it, i've noticed it in another file too) but want to confirm just in case it's a magic incantation on another `curl` impl /cc @grkvlt @Graeme-Miller 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    I'm for the latter so it's easier to just grab it from the snippet and paste it somewhere. Otherwise you'd have the same problem as now - need to paste it somewhere intermediate to remove all those extra characters.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    ah of course.  should we render it as:
    
    ```
    $ for i in byon{1..4}; do
    >   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | awk '\''{print $2}'\'' | xargs kill -9'
    > done
    ```
    
    ?
    
    or i'd say to remove the leading char altogether


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r72659089
  
    --- Diff: guide/start/policies.md ---
    @@ -435,14 +435,14 @@ you could use a load generator like jmeter, or use a script such as the one show
     (changing URL for the URL of your load-balancer):
     
     {% highlight bash %}
    -$ URL=http://10.10.10.101:8000/
    +$ URL=http://10.10.10.101:8080/
    --- End diff --
    
    Good point, will revert.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r72654950
  
    --- Diff: guide/start/policies.md ---
    @@ -435,14 +435,14 @@ you could use a load generator like jmeter, or use a script such as the one show
     (changing URL for the URL of your load-balancer):
     
     {% highlight bash %}
    -$ URL=http://10.10.10.101:8000/
    +$ URL=http://10.10.10.101:8080/
    --- End diff --
    
    I thought nginx would come up on 8000, rather than 8080 (which is the port that the first tomcat would use).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs issue #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-docs/pull/97
  
    The clipboard icon doesn't work on flash-free browsers so better not to depend on it doing the stripping.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by neykov <gi...@git.apache.org>.
Github user neykov closed the pull request at:

    https://github.com/apache/brooklyn-docs/pull/97


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r86776550
  
    --- Diff: guide/start/policies.md ---
    @@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
     
     {% highlight bash %}
     $ for i in byon{1..4}; do
    -$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | awk '\''{print $2}'\'' | xargs kill -9'
    --- End diff --
    
    clipboard support is working fine for me -- just click the icon
    
    would be nice to exclude it from a manual copy/paste but that's harder.  gonna experiment with http://stackoverflow.com/questions/22159929/html-exclude-text-from-clipboard-copy


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-docs pull request #97: Improves examples copy&paste-ability

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/97#discussion_r86775403
  
    --- Diff: guide/start/policies.md ---
    @@ -355,8 +355,8 @@ Tomcat on the vagrant VMs named "byon1" to "byon4":
     
     {% highlight bash %}
     $ for i in byon{1..4}; do
    -$   vagrant ssh ${i} --command 'ps aux | grep -i tomcat |  grep -v grep | awk '\''{print $2}'\'' | xargs kill -9'
    --- End diff --
    
    It's in `_layouts/base.html` section `Clipboard support`.  I'll investigate.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---