2

One of the tedious tasks one takes on when answering questions here is citing from online dictionaries. Since we're encouraged to provide more than a simple link we find ourselves performing little copy and paste chores. However, the text you get when you do this seldom reproduces the format nicely. So you end up also being a copy editor fixing all these little markup errors.

Do you know any good tricks to automate this mindless exercise?

  • Lot of voting up and down but not even a comment. Am I talking about something I shouldn't? – candied_orange Feb 29 '16 at 12:32
  • Deleting a few extraneous words of text is probably not so onerous a chore as to be impeding good contributions to the site, so to be blunt, I think the downvotes are there to say, "Worry about something useful." – choster Mar 2 '16 at 4:54
  • 2
    @choster after being told that cited material should be quoted and presented readably a number of times I reached the conclusion that it was useful. Not sure why you think this is about deleting extraneous words. Editorial discretion isn't something you can automate. This is about what you can. Figured someone else probably does something like this and hoped to hear how they solved the problem. – candied_orange Mar 2 '16 at 13:44
  • ^vote with a quizzical comment: Really? Someone voted this "question" down? Was it mistaken for a suggestion or an opinion survey? Or am I mistaking it for a useful way to collect answer-editing tips for those who might care? Sure beats hiding information in unsearchable and transient comments. I hope that, over time, a variety of tips and templates accumulate here (and that browsers make it easier and easier to copy, label, attribute and link to material in one maneuver). Then we can devote more attention to the aspects of answering that are specific to questions at hand. – lauir Mar 9 '16 at 8:11
2

I've always been willing to work hard to be just a little more lazy. So I wrote a few regular expressions that work in notepad++ on sites like http://dictionary.reference.com/ to automate this process.

Lookup a word.
Copy its definition to notepad++.
Make sure to leave a blank line at the top.
Press ctrl+h and you'll see:

enter image description here

Ensure Search Mode is Regular expression (as shown above)
Fill in find and replace fields (see below)
Press Replace All
Copy to english.stackexchange.com to preview effect.
Repeat as needed.

Be sure to correctly cite your source so everything is above board, nice and legal.

Here are some handy replacements:

Fix numbered points being on a different line
      Find what:([0-9]).\r\n:
Replace with:\1. :

Convert to hard returns, double space lines, add french quote
      Find what:\r\n:
Replace with: \r\n\r\n>:

The two bracketing colons : are not part of these regular expressions. Copy from between them. Spaces aren't preserved well here so it's a hack around that limitation.

Note, \r\n are the windows codes for a newline. If you're on mac or some other *nix you likely just want \n. The nicer text editors let you turn on a mode to show whitespace characters. In notepad++ its View | Show Symbol | Show all characters. This shows \r\n as (CR)(LF).

If you know a better method I'm all ears.

  • Don't reckon the view counter will record all the times I'll look at this, as both an example and a checklist, even though I don't use notepad++ – lauir Mar 9 '16 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .