Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Copying Visual Studio Code into Robohelp

New Here ,
May 02, 2008 May 02, 2008
Hi,
I'm using Robohelp HTML 6 and I'm trying to transfer example code from visual studio into my robohelp project. However, when I copy/paste the code, all of the formatting is lost (mainly colors).

The project I'm working on was done years ago by another individual (whom I no longer have contact with) and contains code examples in the format I'm going for. I can't imagine he went through each example, and indivdually selected a style for each word/line. I've tried editing pages in microsft word (which retains the styles of the copied code) but once I save the file....Robohelp never lets me edit the file in Robohelp again (complains about the file being edited by a third party editor and launches it in MS word). Can anyone tell me how to retain styles when importing the code? Is it possible to develop macros to search my examples and reformat them? Any help would be greatly appreciated.
827
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 02, 2008 May 02, 2008
Take a screenshot (we use SnagIt, here).


Good luck,
Leon
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2008 May 02, 2008
Hi Leon,
Thanks for the quick reply, but words in the code examples need to serve as links to other pages of the manual. I don't think a screenshot would allow for this ability???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 02, 2008 May 02, 2008
I suspect that the colors in visual studio are created internally (i.e. they are not adding formatting tags, but the software is looking for keywords on the fly) and that when you copy to the clipboard only the text is copied. I know that is the way my V+ editor works.

I can't think of an easy way around this. My only idea is to try to print from VS to a document as it might then insert print codes. You would then need to do a search and replace to get those into style sheet or HTML format before you could load them into a topic. It might be as much work as taking Leon's advice and creating image maps for your links.

John
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 02, 2008 May 02, 2008
Apply the different colors either by:

- Creating character styles (p.red, p.blue, etc.) for the different colors
- Creating hyperlink pseudo-classes (a.red:link, a.red:visited, a.red:hover)
- Inserting image maps on the screenshots as John suggested


Good luck,
Leon
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2008 May 02, 2008
quote:

Originally posted by: MergeThis
Apply the different colors either by:

- Creating character styles (p.red, p.blue, etc.) for the different colors
- Creating hyperlink pseudo-classes (a.red:link, a.red:visited, a.red:hover)
- Inserting image maps on the screenshots as John suggested


Good luck,
Leon



I have style set up for each color/text type already. Is their a way to search through the text and apply a certain style to all occurances of a word?

For example: make all "if" instances in this block of text blue?

Applying the style to unformatted text would be a great solution as long as I don't have to manually go through, select a word, and select the style FOR EACH WORD.....I'd be selecting/formatting for weeks.

Also, the replace function doesn't seem to have an option to select styles for replacements (or im just not using it right).
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 05, 2008 May 05, 2008
Keep in mind that when using the RH Multi-File Find & Replace, it cannot identify or replace text in multiple lines.

As to actually replacing content using a better tool such as FAR, you would need to assign the style to one instance, then copy the entire SPAN code to use as the replacement for the word only. This, of course, assumes that only specific words will need this color treatment (such as if, then, var, etc.). If actual analysis is required to determine other color instances, there's nothing for it but to step through each topic manually.


Good luck,
Leon
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 02, 2008 Jun 02, 2008
LATEST
Hi kitklein,

I dont' know if you've found a workable solution, but you can show Visual Studio code in color in RH7 (webhelp) without having to reformat anything. Here's how I just did it (quite accidentally):
1. Copy the Visual Studio code to Word (I'm using Visual Studio 2008 and Word 2007). The colors should remain intact.
2. Save the Word file as a doc or docx (don't think it matters).
3. Import the Word file into RH7. The colors are still shown in the example code with the appropriate <span> tags defining each one.
4. Cut and paste the code you want into your topics.

Appears to work like a charm in RH7, not sure if it would for RH6.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp