How to set tab indentation in Google Code? - google-code

I use Visual Studio as my development environment, and tab indentation is 4, but after I commit to Google Code, the indentation is 8 in the browser, which makes my code look ugly.
Does anyone know how to reset the tab indentation to 4 when looking at it in web browser?

Apparently this is not supported. This enhancement request was filed nearly 5 years ago, and is still marked as "won't fix":
If you rely on tabs to be some width other than 8 spaces for your code to be
formatted correctly, then other contributors will have trouble reading your code. If
you do prefer hard tabs, it's good practice to use spaces (not tabs) for any
formatting/alignment other than plain indentation: that way, your code will look all
right no matter what the tab width.
I don't see us taking action on this in the foreseeable future: it would be adding
complexity to project administration to enable something that really isn't such a
great idea anyway.
–artdent
So it looks like you are out of luck. I guess that's what you get for using tabs instead of spaces. Tabs require far too much support from the editor, and high quality editors are sadly still not ubiquitous.
It is trivial to configure Visual Studio to use spaces everywhere instead of tabs, including when you press the Tab key:
Tools → Options → Text Editor → <language> → Tabs → Insert Spaces
If you don't want to use spaces everywhere, you could set up your source control system to convert tabs to spaces when you commit code, and convert the spaces back to tabs when you check out. Sounds like a lot of effort just to work around the limitations of one of your tools, but it wouldn't be that hard in practice once you got it set up.

Related

Is it possible to change Drupal's coding standards or get around tiny spacing?

In order to submit a drupal module, you must adhere to Drupal's coding standards. The problem with the coding standards, is that it has one specific and very annoying standard: indenting. I absolutely hate that the indenting is:
Use an indent of 2 spaces, with no tabs.
If it was 4, then I could live with it. Is there any way to go about convincing Drupal to change these standards, or at the very least, is there a way others deal with this? Perhaps a Netbeans plugin that shows single spaces as double or something similar?
No one is going to change Drupal's coding standards.
You can write your code in your style but before submitting it, you can just "autoformat" all the code (Alt + Shift + F) with the Drupal coding standards which can be configured at: Tools -> Options -> Editor.

Change color of multiple separated lines of text in Wordpress?

I want to change the color of multiple lines of text in Wordpress.
The lines are separated like this:
Line 1 (change to green)
some other lines
Line 2 (change to green)
some other lines
Line 3 (green)
I have used CTRL and selected all the lines but when I change the color it deselects all lines except for the last one?
I would also like to insert multiple horizontal rules at different points on a page without doing them one by one.
I think the text editor is defected if it won't allow a simple ctrl and select multiple items?
The problem with the Wordpress Visual Editor is that it was built for the lowest common denominator of users in mind. Basically, it's only useful for people with little to no experience in HTML and CSS.
Most of the time, the Visual Editor's output will either be just plain messy - or wrong - for developers to use it in a clean and concise way.
Your question has more to do with the usability of the Wordpress Visual Editor rather than HOW to use it. What I would suggest if you are not comfortable with editing your content using the HTML View (which can allow you to format your content on a much more granular level) is to copy all of your content into a Text Editor like Microsoft Word, making the changes you want, and then pasting everything back into the Editor.
It actually does fairly well using that method.
While Wordpress does the job in making things as easy as possible for the less technologically adept users, it is not foolproof. If you feel that its usability is flawed on a very fundamental level, my suggestion would be to contact the Wordpress Development team in the Wordpress forums.
Good luck.
http://wordpress.org/support/

What are appropriate markup languages for users with disabilities?

Suppose you're developing a web site and blind users will be a significant chunk of your target market. If the web site includes document editing functionality, what would be appropriate WYSIWYM tools? Are languages like Markdown, Textile and Wiki Formatting really accessible or are they inconvenient to blind users?
I'm a blind programmer and while I haven't used most of the languages you mention I've found that any markdown language is fairly easy to use if you have the desire to learn it. I've had no problem using either HTML or several markup languages for wiki's. Part of it will depend on how invested the users are in your site. If it's a site that will be visited infrequently or for short periods of time, it's much less likely that a user will take the time to learn the required markup whether they are blind or not. Unfortunately, I have not found an accessible JavaScript WYSIWYG editor but I find it easier to manually enter the markup so haven't looked very hard.
the first question is: how important is semantic structure? could you get away with plain text. You could do simple parsing like treating blank lines as paragraph markers, treating a series of lines which begin with * as a bulleted list, identify URLs and make them into links, etc.
As a blind developer myself, I have no problem in understanding languages like Markdown. But if it's a syntax I'm unfamiliar with, I'll only learn it if I expect to use the site very often, or care deeply about the content.
Two final thoughts come to mind: while I certainly experience some accessibility challenges using TinyMCE, you could develop something much simpler - provide less than 10 formatting options, like inserting hyperlinks, making lists, centering text, setting the style (such as heading) etc.
And lastly, when I talk to non-technical blind people, they often just write their content in Word and paste into a wiki or blog post. This sounded strange when I first heard it, but it does make sense. So an ideal solution would accept pasted in content.
In closing - it depends how important this is, and how much effort you want to expend. Maybe a Markdown editor with a live preview (like on this site), buttons for inserting simple formatting like URLs, and the ability to paste in rich text would tick all boxes :-)
On a web page, the most accessible embedded text editor for blind users is one that uses standard HTML, such as a <textarea> element, with a corresponding <label> element:
<label for="editor">Enter your text here using wiki markup:</label>
<textarea id="editor"></textarea>
If a WYSIWYM tool is built using standard accessible HTML, then blind users can easily enter text into it, with full confidence that they're entering text in the right place. Then the question becomes: Which is the better markup language? They all require memorization, but some may be more intuitive than others. One way to find out which is best would be to do some usability testing with a wide variety of target users. Also be sure to providing easy, accessible access to syntax help.
Picture yourself working in pure text 80x4 display (just open a console and resize appropriately), then use vi/emacs/ed and you'll soon realize what markup will get in the way.
Try to do as much work as possible to understand plain text, else use light markup like POD, finally things like AsciiDoc are very powerful but needs training.
I don't know about WYSIWYG/WYSIWYM tools, but I do know that complying with W3C standards (especially their HTML5 en CSS3 drafts) while writing your own editor code will help a lot.
In CSS you can specify speed and intonation of speech. In HTML you can specify alternative text (alt attribute in many elements) that screen readers are compatible with. Be sure to know when to use the abbr and the acronym elements. Use the former when you want the screen reader to read the meaning of an abbreviation and the latter when the acronym should be read as a word (e.g. ASAP, NATO and OS).
For the editor itself, I recommend creating a WYSIWYG editor that uses divs and spans. Screen readers will understand easily the structure of a document. For the current line, use a text box; for every other line that's not being edited, convert the contents immediately to valid HTML.
If you find a good tool, be sure to post it here. I'm looking for one too. :-)

ASP.NET code formatting tool

Is there any tool for Visual Studio 2008 which can reformat ASPX code to make it more presentable (eg insert line breaks, format the lines so they wrap when necessary, etc)?
Thanks
Have you tried hitting Ctrl+K+D? Is this what you're referring to?
http://blogs.msdn.com/markhsch/archive/2008/01/10/visual-studio-tip-autoformat-your-code.aspx
To have Visual Studio fix it all up nice and tidy for you, select the text, hold CTRL and hit K followed by F (CTRL+K-F). What I usually do is do a CTRL-A to select all text then do the CTRL+K-F combo. Voila!
You can also do it from the menu Edit > Advanced > Format Document or toolbar.
alt text http://img148.imageshack.us/img148/8872/formatdoc2.png
There are actually a number of tools dedicated to code formatting that you might want to take a look at. Visual Studio's formatting capabilities are actually quite limited, and a lot of projects I have worked on use one of these external tools.
Good luck!
This may not be directly related to your issue, but DevExpress has a free product CodeRush Express that will not only help with tidying but has a great interface for refactoring. Here is a link to their demo video. I've used their products for a few years and they really up your productivity.
After 11 years there is still no tool that does it right. All online formatters I found dont cope well with ASP (.NET/Core/Blazor) tags, and VS20xx (even the latest 2022) doesn't deal with tags from custom controls, it formats all, except for sections within custom tags. In my case, 90% of the aspx files.

What is the best way to get clean semantic XHTML from MS word documents?

Some days ago I received a rather lengthy and somewhat elaborate MS Word document, which I was asked to convert to HTML for uploading to a 3rd party’s website. My first instinct was to save the Word document as HTML and use Dreamweaver’s "Clean Up Word HTML" Command. But not only did I have to leave it running all night for Dreamweaver to finish "cleaning", but the results were far from desirable in my opinion. There were still a lot of left over inline styles, etc. that Dreamweaver just plain missed.
I approached it differently this morning and just selected the entire document in Word, copied it, and then pasted it into Dreamweaver’s Design window. Not only was it much, much faster, but the output code was much, much cleaner! I didn’t have to run the "Clean Up Word HTML" Command afterwords either.
Now I don't ever convert a Word File straight to HTML for standards reasons. Instead I cut and paste content between Word and Dreamweaver. Happily I can do the following.
If a Word heading is in the Heading 1 Style, it will become an H1 in Dreamweaver (following the Dreamweaver stylesheet). Similarly Heading 2 becomes H2, Heading 3 becomes H3 and so forth.
If the Word author wasn't that organized, you can use a shortcut like Control+1 (or Command+1) on a Mac to convert any line to an H1. Can you guess the shortcut for H2? Yes it's Control+2 or Command+2 on a Mac.
Paragraphs now cut and paste as paragraphs (with the P tag). If you don't want an HTML paragraph right then, then use Control+0 (or Command+0 on a Mac) to remove it in Dreameaver.
A new one I discovered is that some embedded images in Word may be transferred to your Dreamweaver site as "clip" images when you copy and paste from Word. So, if you have a Word file with embedded images, you may be able to extract them fairly quickly via Dreamweaver.
I also found this free tool useful http://www.textfixer.com/html/convert-word-to-html.php it works same like design view of dreamweaver, useful for people who doesn't have Dreamweaver.
but what code we will get is depends on how much properly formatted MS word document is?
WORD 2007 has also style like html?
Headings, tables, ordered and unordered lists, bold, italic , hyperlinks etc?
How to use word 2007 semantically?
To get maximum possible semantic html
on save as html option
To get maximum possible clean code to
Copy in dreamweaver design view ?
To get maximum possible clean code to
place browser based WYSIWYG HTML
Editor which comes with every CMS
Does any knows any tips, tricks, tutorial , article or advice to format MS WORD documents semantically?
Or any other best way than mine?
HTML Tidy has options for this: word-2000, bare and clean.
FCKEditor and similar try to clean up code pasted from Word.
There's (rather old now) demoroniser.
However don't expect miracles. It's unlikely that Word document will have decent structure (it theoretically could, but no Word user bothers with this). These programs can't add semantic information if it's not there.
As for semantic editing in Word – use styles. It supports headers properly (sadly not much else). You can check that in outline view.
You don't need – and shouldn't use – spaces or line breaks for indentation or space adjustment. Word has ability to explicitly control paragraphs' padding.
I've found that the OpenOffice.org html generator (Open .doc in OO and save as HTML) works better than MS's in Office.
It's still not perfect, but gives MUCH cleaner HTML that's much more sane to look at.
There is no dependable way to clean up WORD docs and make them into nice HTML. If the document has any special characters, they are often encoded as Windows charset instead of UTF-8, so they just "break" when displayed online. The list goes on. You often end up with silliness like:
<strong>hello</strong><strong>th<strong>er</strong>e</strong><i></i>
The only depandable method is to paste it into Notepad and mark it up manually. You can write a few macros to do things like insert <p></p> at paragraph breaks, but that's about it.
If there is a huge volume of material that needs to go online from Word, you may be better off using a PDF.
have you tried this? Word Cleaner
Try our Doc To HTML Converter software. It was designed specially for the purpose of producing maximum possible clear (X)HTML code, and has many customizable options. It requires MS Word to be installed on your system. It is not free, but it has trial 30-day period.

Resources