Skip to content

Commit

Permalink
HTML formatting to fit standard of rest of page
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Oliveros committed May 24, 2024
1 parent 1e3e32f commit 651686f
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 170 deletions.
50 changes: 27 additions & 23 deletions lib/adiwg/mdtranslator/writers/html/sections/html_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,49 @@ def writeHtml(hEvent)

# eventId
unless hEvent[:eventId].nil?
@html.em('Event ID', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hEvent[:eventId])
end
@html.em('Event ID: ')
@html.text!(hEvent[:eventId])
@html.br
end

# identifier
unless hEvent[:identifier].empty?
@html.em('Identifier: ')
@html.section(:class => 'block') do
identifierClass.writeHtml(hEvent[:identifier])
@html.details do
@html.summary('Identifier', {'class' => 'h4'})
@html.section(:class => 'block') do
identifierClass.writeHtml(hEvent[:identifier])
end
end
end
end

# trigger
unless hEvent[:trigger].nil?
@html.em('Trigger', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hEvent[:trigger])
end
@html.em('Trigger: ')
@html.text!(hEvent[:trigger])
@html.br
end

# context
unless hEvent[:context].nil?
@html.em('Context', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hEvent[:context])
end
@html.em('Context: ')
@html.text!(hEvent[:context])
@html.br
end

# sequence
unless hEvent[:sequence].empty?
@html.em('Sequence', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hEvent[:sequence])
end
unless hEvent[:sequence].nil?
@html.em('Sequence: ')
@html.text!(hEvent[:sequence])
@html.br
end

# time
unless hEvent[:dateTime].nil?
unless hEvent[:dateTime].nil? || hEvent[:dateTime].empty?
@html.em('Datetime: ')
@html.section(:class => 'block') do
@html.text!.writeHtml(hEvent[:dateTime])
@html.text!.writeHtml(hEvent[:dateTime][:dateTime].to_s)
end
end

Expand All @@ -85,9 +85,13 @@ def writeHtml(hEvent)

# relatedPass
unless hEvent[:relatedPass].empty?
@html.em('Related Pass: ')
@html.section(:class => 'block') do
passClass.writeHtml(hEvent[:relatedPass])
@html.details do
@html.summary('Related Pass', {'class' => 'h4'})
@html.section(:class => 'block') do
passClass.writeHtml(hEvent[:relatedPass])
end
end
end
end

Expand Down
49 changes: 33 additions & 16 deletions lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,46 @@ def writeHtml(hInstrument)

# instrumentId
unless hInstrument[:instrumentId].nil?
@html.em('Instrument ID', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hInstrument[:instrumentId])
end
@html.em('Instrument ID: ')
@html.text!(hInstrument[:instrumentId])
@html.br
end

# identifier
unless hInstrument[:identifier].empty?
@html.em('Identifier: ')
@html.section(:class => 'block') do
identifierClass.writeHtml(hInstrument[:identifier])
@html.details do
@html.summary('Identifier', {'class' => 'h4'})
@html.section(:class => 'block') do
identifierClass.writeHtml(hInstrument[:identifier])
end
end
end
end

# instrumentType
unless hInstrument[:instrumentType].nil?
@html.em('Instrument Type', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hInstrument[:instrumentType])
end
@html.em('Instrument Type: ')
@html.text!(hInstrument[:instrumentType])
@html.br
end

# description
unless hInstrument[:description].nil?
@html.em('Description', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hInstrument[:description])
end
@html.em('Description: ')
@html.text!(hInstrument[:description])
@html.br
end

# mountedOn
unless hInstrument[:mountedOn].empty?
@html.em('Mounted On', {'class' => 'h4'})
@html.section(:class => 'block') do
platformClass.writeHtml(hInstrument[:mountedOn])
@html.details do
@html.summary('Mounted On', {'class' => 'h4'})
@html.section(:class => 'block') do
platformClass.writeHtml(hInstrument[:mountedOn])
end
end
end
end

Expand All @@ -72,7 +77,19 @@ def writeHtml(hInstrument)
end
end
end

# hostId
unless hInstrument[:hostId].empty?
@html.section(:class => 'block') do
@html.details do
@html.summary('Host ID', {'class' => 'h4'})
@html.section(:class => 'block') do
identifierClass.writeHtml(hInstrument[:hostId])
end
end
end
end

end # writeHtml
end # Html_Instrument
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,29 @@ def writeHtml(hInstrumentationEvent)
end

# description
unless hInstrumentationEvent[:description].empty?
unless hInstrumentationEvent[:description].nil?
@html.em('Description: ')
@html.section(:class => 'block') do
@html.text!(hInstrumentationEvent[:description])
end
@html.text!(hInstrumentationEvent[:description])
@html.br
end

# extent
unless hInstrumentationEvent[:extent].empty?
@html.em('Extent: ')
@html.section(:class => 'block') do
extentClass.writeHtml(hInstrumentationEvent[:extent])
@html.details do
@html.summary('Extent', {'class' => 'h4'})
@html.section(:class => 'block') do
extentClass.writeHtml(hInstrumentationEvent[:extent])
end
end
end
end

# eventType
unless hInstrumentationEvent[:eventType].empty?
unless hInstrumentationEvent[:eventType].nil?
@html.em('Event Type: ')
@html.section(:class => 'block') do
@html.text!(hInstrumentationEvent[:eventType])
end
@html.text!(hInstrumentationEvent[:eventType])
@html.br
end

# revisionHistory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,35 @@ def writeHtml(hInstrumentationEventList)

# citation
unless hInstrumentationEventList[:citation].empty?
@html.em('Citation: ')
@html.section(:class => 'block') do
citationClass.writeHtml(hInstrumentationEventList[:citation])
@html.details do
@html.summary('Citation', {'class' => 'h4'})
@html.section(:class => 'block') do
citationClass.writeHtml(hInstrumentationEventList[:citation])
end
end
end
end

# desctiption
unless hInstrumentationEventList[:description].empty?
unless hInstrumentationEventList[:description].nil?
@html.em('Description: ')
@html.section(:class => 'block') do
@html.text!(hInstrumentationEventList[:description])
end
@html.text!(hInstrumentationEventList[:description])
@html.br
end

# locale
unless hInstrumentationEventList[:locale].empty?
@html.em('Locale: ')
@html.section(:class => 'block') do
localeClass.writeHtml(hInstrumentationEventList[:locale])
@html.details do
@html.summary('Locale', {'class' => 'h4'})
@html.section(:class => 'block') do
localeClass.writeHtml(hInstrumentationEventList[:locale])
end
end
end
end

# constraints
unless hInstrumentationEventList[:constraints].empty?
@html.section(:class => 'block') do
Expand Down
36 changes: 14 additions & 22 deletions lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ def writeHtml(hObjective)
instrumentClass = Html_Instrument.new(@html)

# objectiveId
unless hObjective[:objectiveId].empty?
@html.em('Objective ID', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hObjective[:objectiveId])
end
unless hObjective[:objectiveId].nil?
@html.em('Objective ID: ')
@html.text!(hObjective[:objectiveId])
@html.br
end

# identifier
Expand All @@ -46,11 +45,10 @@ def writeHtml(hObjective)
end

# priority
unless hObjective[:priority].empty?
@html.em('Priority', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hObjective[:priority])
end
unless hObjective[:priority].nil?
@html.em('Priority: ')
@html.text!(hObjective[:priority])
@html.br
end

# objectiveType
Expand All @@ -59,12 +57,9 @@ def writeHtml(hObjective)
@html.details do
@html.summary('Objective Types', {'class' => 'h4'})
hObjective[:objectiveTypes].each do |type|
@html.section(:class => 'block') do
@html.details do
@html.summary('Type', {'class' => 'h5'})
@html.text!(type)
end
end
@html.em('Type: ')
@html.text!(type)
@html.br
end
end
end
Expand All @@ -76,12 +71,9 @@ def writeHtml(hObjective)
@html.details do
@html.summary('Functions', {'class' => 'h4'})
hObjective[:functions].each do |function|
@html.section(:class => 'block') do
@html.details do
@html.summary('Function', {'class' => 'h5'})
@html.text!(function)
end
end
@html.em('Function: ')
@html.text!(function)
@html.br
end
end
end
Expand Down
45 changes: 21 additions & 24 deletions lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ def writeHtml(hOperation)


# operationId
unless hOperation[:operationId].empty?
@html.em('Operation ID', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hOperation[:operationId])
end
unless hOperation[:operationId].nil?
@html.em('Operation ID: ')
@html.text!(hOperation[:operationId])
@html.br
end

# description
unless hOperation[:description].empty?
@html.em('Description', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hOperation[:description])
end
unless hOperation[:description].nil?
@html.em('Description: ')
@html.text!(hOperation[:description])
@html.br
end

# citation
unless hOperation[:citation].empty?
@html.section(:class => 'block') do
Expand All @@ -65,31 +64,29 @@ def writeHtml(hOperation)
end

# status
unless hOperation[:status].empty?
@html.em('Status', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hOperation[:status])
end
unless hOperation[:status].nil?
@html.em('Status: ')
@html.text!(hOperation[:status])
@html.br
end

# operationType
unless hOperation[:operationType].empty?
@html.em('Operation Type', {'class' => 'h4'})
@html.section(:class => 'block') do
@html.text!(hOperation[:operationType])
end
unless hOperation[:operationType].nil?
@html.em('Operation Type: ')
@html.text!(hOperation[:operationType])
@html.br
end

# objective
unless hOperation[:objectives].empty?
@html.section(:class => 'block') do
@html.details do
@html.summary('Plans', {'class' => 'h4'})
hOperation[:objectives].each do |operation|
@html.summary('Objectives', {'class' => 'h4'})
hOperation[:objectives].each do |objective|
@html.section(:class => 'block') do
@html.details do
@html.summary('Plan', {'class' => 'h5'})
objectiveClass.writeHtml(operation)
@html.summary('Objective', {'class' => 'h5'})
objectiveClass.writeHtml(objective)
end
end
end
Expand Down
Loading

0 comments on commit 651686f

Please sign in to comment.